problem with hotmail

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
mbasil77
Forum Newbie
Posts: 3
Joined: Thu Oct 04, 2007 1:50 pm

problem with hotmail

Post by mbasil77 »

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:

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
Last edited by mbasil77 on Thu Oct 04, 2007 2:38 pm, edited 1 time in total.
chuckl
Forum Commoner
Posts: 61
Joined: Wed May 23, 2007 7:36 am

Post by chuckl »

If you find a way to customise Swiftmailer so that it will always deliver email to the intended recipient, please sell us all shares in the company first. We also want to be billionaires.

I think you are being a little harsh on your code, I doubt it has very much to do with it. There are a great many reasons why the web email services seemingly arbitrarily dump your email, but 'because we can is a good start.

http://www.swiftmailer.org/wikidocs/v3/tips/spam
mbasil77
Forum Newbie
Posts: 3
Joined: Thu Oct 04, 2007 1:50 pm

Post by mbasil77 »

I can undertand the kind of way of your answer.

The only thing i asked was if i could customise swift mailer to deliver the messages in a hotmail acount (my hotmail account) and don't lose any message.

After tries i have made, the same data one time is delivered and the other failed.

In any other account i have tried (gmail.....) the message is delivered regurarly.

Thank you for anwer but i don't want to be billionaire. I want to do my job.
chuckl
Forum Commoner
Posts: 61
Joined: Wed May 23, 2007 7:36 am

Post by chuckl »

All your code does is deliver the mail to a mail server, which is then responsible for sending it to the recipients mail server, in this case Hotmail.

The decision whether or not to accept the email or whether or not to forward it to the recipient depends on the setup of the domain from which you are sending, a lot more than it does on your code.

You could examine the email headers of the emails that have been received, and make sure that the From, Return Path or Reply To addresses in the headers are correct, that the Subject is correct and things like that, but other than that there is not a whoe lot else you can do from the code.

It is, after all, sending the mail.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Sounds like a SPF issue or a reverse DNS problem to me. Did you read that link?
mbasil77
Forum Newbie
Posts: 3
Joined: Thu Oct 04, 2007 1:50 pm

Post by mbasil77 »

Yes i have read this link and i end up to the same conclusion. I have also to discuss the problem with the smtp provider from which emails sent.

After tries i did, it seems that the problem exists only when i try to sent emails continually. I think that maybe this is a method of hotmail against spam emails.

I continue to make tries.

Thanks for your respond.
Post Reply