Need help to send mail to multiple receivers

so far i have in table format
$data :

Name       Email
-------    -------
person1    person1@gmail.com
person2    person2@gmail.com

I want to sent each person a seperate mail mentioning their name in respective email
i.e Hello how u doin’

Hello Person1  how u doin'
Hello Person2  how u doin'

I need help with integration with below code

#Email Part
function Send-Email() {
    param (
        [Parameter(mandatory=$true)][string]$To,
        [Parameter(mandatory=$true)][string]$Subject,
        [Parameter(mandatory=$true)][string]$Body
    )
    
    #Get user credentials
    $username = (Get-Content -Path " ")[0]
    $password = (Get-Content -Path " ")[0][1] | ConvertTo-SecureString -AsPlainText -Force

    #Create Hash for Email
    $email = @{
        from = $username
        to = $To
        subject = $Subject
        smtpserver = "smtp.gmail.com"
        body = $Body
        credential = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password
        usessl = $true
        verbose = $true 
        }
     Send-MailMessage $email
}

Thanks for your help!

When you use splatting, you need to use a @ in front of the variable, not $. Wrapping the Send-MailMessage doesn’t really provide any value, here is a quick example:

$data = @"
Name,Email
Name1,person1@company.com
Name2,person2@company.com
"@ | ConvertFrom-Csv 

#Get user credentials
$username = (Get-Content -Path " ")[0]
$password = (Get-Content -Path " ")[0][1] | ConvertTo-SecureString -AsPlainText -Force

foreach ($user in $data) {

    #Create Hash for Email
    $email = @{
        from       = $username
        to         = $user.Email
        subject    = $Subject
        smtpserver = "smtp.gmail.com"
        body       = $Body
        credential = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password
        usessl     = $true
        verbose    = $true 
    }

    Send-MailMessage @email
}