include_once 'PATH/TO/swift_required.php';
//put info into an array to send to the function
$info = array(
'username' => $username,
'email' => $email,
'key' => $key
);
//send the email
if(send_email($info)){
//email sent
$action['result'] = 'success';
array_push($text,'Thanks for signing up. Please check your email for confirmation!');
}else{
$action['result'] = 'error';
array_push($text,'Could not send confirm email');
}
I am using the above code and it is giving me this error.Please help
Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given [] does not comply with RFC 2822, 3.6.2.' in /path/to/MailboxHeader.php:319 Stack trace: #0 /path/to/MailboxHeader.php(249): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('') #1 /path/t/MailboxHeader.php(107): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array) #2 /path/t/MailboxHeader.php(71): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array) #3 /path/t/SimpleHeaderFactory.php(74): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array) #4 /path/t/SimpleHeaderSet.php(87): Swift_Mime_SimpleHeaderFactory->createMailboxH in /path/t/MailboxHeader.php on line 319