problem with hotmail
Posted: Thu Oct 04, 2007 2:05 pm
I have the following problem:
When i tried to sent a message with a contact form info to a hotmail account i had problems. The message didn't delivered some times and some times delivered regularly.
I wonder if there is a way to customise the swift mailer so that the message deliver in any email account.
the code i use is:
The $body variable contains tha form info.
The $first variable contains name that user fill in the form
The $email variable contains email address that user fill in the form
And the $email_to variable contains the email address i want to sent the message.
thanks in advance
When i tried to sent a message with a contact form info to a hotmail account i had problems. The message didn't delivered some times and some times delivered regularly.
I wonder if there is a way to customise the swift mailer so that the message deliver in any email account.
the code i use is:
Code: Select all
require_once "".SITE_PATH."include/swift/Swift.php";
require_once "".SITE_PATH."include/swift/Swift/Connection/SMTP.php";
require_once ''.SITE_PATH.'include/swift/Swift/Authenticator/LOGIN.php';
$connection =& new Swift_Connection_SMTP("smtp server",25);
$connection->setUsername("username");
$connection->setPassword("password");
$connection->attachAuthenticator(new Swift_Authenticator_LOGIN());
$swift =& new Swift($connection);
$message1 =& new Swift_Message();
$message1->headers->setCharset("windows-1253");
$message1->headers->set("Subject" , $subject);
$sender =& new Swift_Address("",$first);
$sender->setAddress($email);
$part1 =& new Swift_Message_Part($body, "text/plain");
$part1->setCharset("windows-1253");
$message1->attach($part1);
$recipients =& new Swift_RecipientList();
$batch =& new Swift_BatchMailer($swift);
$recipients->addTo($email_to);
$batch->send($message1, $recipients, new Swift_Address($email,$first));
$swift->disconnect();The $body variable contains tha form info.
The $first variable contains name that user fill in the form
The $email variable contains email address that user fill in the form
And the $email_to variable contains the email address i want to sent the message.
thanks in advance