[SOLVED] Emailing fails to both Hotmail and Yahoo
Moderators: Chris Corbyn, General Moderators
-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
[SOLVED] Emailing fails to both Hotmail and Yahoo
Hello,
This has been driving me nuts all day!
I've been sending identical mails to 4 test accounts today, and SwiftMailer sends to 2 of them (my personal one and the site's), but not Yahoo or Hotmail. All that changes are the to addresses - all of which are kosher (however, I'm not going to repeat them here!).
The script is VERY basic:
- Set up the mailer
- Set up the connection
- Set up the addresses as an array of Swift_Address objects
- Loop through the Address objects and send
Anyway, it just fails on the last 2!
Does anyone know why, or can SwiftMailer itself tell me? I'm finding SM's OOPness somewhat overwhelming to track down the bug.
HOWEVER, I am very pleased that Swift knows they're failing, as hopefully there's some way to find out WHY.
I'd just like a nice easy $swift->debug() or something, if it's available.
I have to make a site go live tomorrow afternoon and I'm tearing my hair out.
Thanks very much for reading,
Dave Stewart
This has been driving me nuts all day!
I've been sending identical mails to 4 test accounts today, and SwiftMailer sends to 2 of them (my personal one and the site's), but not Yahoo or Hotmail. All that changes are the to addresses - all of which are kosher (however, I'm not going to repeat them here!).
The script is VERY basic:
- Set up the mailer
- Set up the connection
- Set up the addresses as an array of Swift_Address objects
- Loop through the Address objects and send
Anyway, it just fails on the last 2!
Does anyone know why, or can SwiftMailer itself tell me? I'm finding SM's OOPness somewhat overwhelming to track down the bug.
HOWEVER, I am very pleased that Swift knows they're failing, as hopefully there's some way to find out WHY.
I'd just like a nice easy $swift->debug() or something, if it's available.
I have to make a site go live tomorrow afternoon and I'm tearing my hair out.
Thanks very much for reading,
Dave Stewart
-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You're being blacklisted probably. I have no problems emailing anybody from my own server or from our servers at work.
Are you sending from a mail server or by sendmail? If you're not sending from a server that shows as having a MX record you could be blacklisted. If you're sending from a dynamic IP you're almost certainly blacklisted by default and if you're sending from a shared hosting account your chances of being blacklisted are high.
Put in here: http://www.robtex.com/rbls.html
The IP of your SMTP server (if using SMTP)
The IP of your server (if using sendmail)
If anything is red then it's possible you're not going to do be able to solve the problem. Sometimes if you click the link to the actual blacklister you can get yourself removed within a few hours.
Make sure the domain from which you're sending emails has a SPF record set up. If you try sending from domain1.tld using domain2.tld's SMTP server you may also experience issues due to SPF rules.
http://www.swiftmailer.org/wikidocs/v3/tips/spam
Are you sending from a mail server or by sendmail? If you're not sending from a server that shows as having a MX record you could be blacklisted. If you're sending from a dynamic IP you're almost certainly blacklisted by default and if you're sending from a shared hosting account your chances of being blacklisted are high.
Put in here: http://www.robtex.com/rbls.html
The IP of your SMTP server (if using SMTP)
The IP of your server (if using sendmail)
If anything is red then it's possible you're not going to do be able to solve the problem. Sometimes if you click the link to the actual blacklister you can get yourself removed within a few hours.
Make sure the domain from which you're sending emails has a SPF record set up. If you try sending from domain1.tld using domain2.tld's SMTP server you may also experience issues due to SPF rules.
http://www.swiftmailer.org/wikidocs/v3/tips/spam
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
For debugging:
Code: Select all
$swift = new Swift( ... );
$swift->log->enable();
//do all th sending and stuff....
echo "<pre>";
$swift->log->dump();
echo "</pre>";-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
Chris,
Thanks so much for your reply. It really is appreciated.
I got onto my hosting provider last night as well and had to really hold my nerve as they kept fobbing me off. But eventually (I guess the shifts changed) one bright spark did some checking and informed me that one of my nameservers was wrong. Turns out they were providing misleading details in their own support pages! So I've updated these and am waiting for it to go through.
Hopefully, this will be where the problem lies and I can move forwards.
You know, I was actually using PHPMailer, and turned to Swift in desperation. It's certainly more complicate to set up, and I'll probably wrap the class myself in something a little easier to manage day-to-day, as your EasySwift isn't documented yet.
However, the error reporting is one feature that PHPMailer doesn't have, and in this case it's been a real boon.
So many thanks for the input and the tool! You certainly know your stuff.
I'll keep you posted on the NS stuff, and may report back.
Many thanks for your help in the meantime.
Cheers,
Dave
Thanks so much for your reply. It really is appreciated.
I got onto my hosting provider last night as well and had to really hold my nerve as they kept fobbing me off. But eventually (I guess the shifts changed) one bright spark did some checking and informed me that one of my nameservers was wrong. Turns out they were providing misleading details in their own support pages! So I've updated these and am waiting for it to go through.
Hopefully, this will be where the problem lies and I can move forwards.
You know, I was actually using PHPMailer, and turned to Swift in desperation. It's certainly more complicate to set up, and I'll probably wrap the class myself in something a little easier to manage day-to-day, as your EasySwift isn't documented yet.
However, the error reporting is one feature that PHPMailer doesn't have, and in this case it's been a real boon.
So many thanks for the input and the tool! You certainly know your stuff.
I'll keep you posted on the NS stuff, and may report back.
Many thanks for your help in the meantime.
Cheers,
Dave
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
PHPMailer will likely never have any more updates released when you look at its development activity (nothing since 2005).davestewart wrote:You know, I was actually using PHPMailer, and turned to Swift in desperation. It's certainly more complicate to set up, and I'll probably wrap the class myself in something a little easier to manage day-to-day, as your EasySwift isn't documented yet.
EasySwift is actually going to be removed eventually. It's @deprecated and was only added so that developers making the move from Swift v2 to Swift v3 could use it as a compat class. It'll probably sit in the archive for a year or so before it finally disappears but I'll make announcements many months in advance.
Good luck with getting your hosting problems sorted. The answer they've given you certainly sounds legitimate
-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
Hi Chris,
You know I wouldn't be so hasty about ditching EasySwift. I'm a freelancer doing many, many things. I used to specialize in 3D animation, then about 5 years ago got into HTML, then Flash, and these days do everything from PHP thru Flash thru scripting 3D plugins for 3dsmax. You can see my stuff here. The point I'm making is that I'm pretty good in some stuff, Excellent in others, but don't always have the time to learn everything.
I spent a good few hours last night, moments away from ditching Swift until I started to get my head round the object model. Now for me, sending mail is supposed to be a fairly trivial task within the wider scope of developing a site, and the OOP approach just seemed like overkill.
The point is, not everyone is a complete propeller-head PHP developer and by not giving those lesser (but still very bright) mortals a foot in the door, you're not going to get their business as you'll see nothing but dust as they run away screaming.
Bottom line: I just don't have the time to get all OOP with a simple confirmation email!! I want to create some HTML, add some addresses, and send the damn thing. A basic wrapper class is what I would imagine most people (me included) need.
You get the idea. Sorry if I'm preaching to the converted, I just think you're cutting off your nose dispite your face if you dump it.
You know I was just about to donate to PHP Mailer, but as I've ground to a halt that ain't gonna happen now.
But if Swift can come to the rescue, then I know where my money's going!
I'll probably need some more help in a minute. Watch this space...
You know I wouldn't be so hasty about ditching EasySwift. I'm a freelancer doing many, many things. I used to specialize in 3D animation, then about 5 years ago got into HTML, then Flash, and these days do everything from PHP thru Flash thru scripting 3D plugins for 3dsmax. You can see my stuff here. The point I'm making is that I'm pretty good in some stuff, Excellent in others, but don't always have the time to learn everything.
I spent a good few hours last night, moments away from ditching Swift until I started to get my head round the object model. Now for me, sending mail is supposed to be a fairly trivial task within the wider scope of developing a site, and the OOP approach just seemed like overkill.
The point is, not everyone is a complete propeller-head PHP developer and by not giving those lesser (but still very bright) mortals a foot in the door, you're not going to get their business as you'll see nothing but dust as they run away screaming.
Bottom line: I just don't have the time to get all OOP with a simple confirmation email!! I want to create some HTML, add some addresses, and send the damn thing. A basic wrapper class is what I would imagine most people (me included) need.
Code: Select all
$mail->addAddress()
$mail->setHTML()
$mail->addInlineAttachment()
$mail->addEmbeddedImage()
$mail->send()You know I was just about to donate to PHP Mailer, but as I've ground to a halt that ain't gonna happen now.
But if Swift can come to the rescue, then I know where my money's going!
I'll probably need some more help in a minute. Watch this space...
-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
Hi Chris,
I've run the code on a different domain (where the nameservers are legit), and same result. Fine to some domains, but not to others.
In this case I've basically used your code from the docs section of the site - can you help?
I've set up a demo page at (link taken down)
It attempts to send 5 emails then dumps a load of information so you can see what's going on
- Sends the emails and reports results
- Displays the email (the embedded image won't show)
- Dumps the error log
- Displays the PHP used
I'm sorry to bug you like this, but I find it very strange that I cannot send mail to any of the big email handlers.
Many thanks,
Dave Stewart
I've run the code on a different domain (where the nameservers are legit), and same result. Fine to some domains, but not to others.
In this case I've basically used your code from the docs section of the site - can you help?
I've set up a demo page at (link taken down)
It attempts to send 5 emails then dumps a load of information so you can see what's going on
- Sends the emails and reports results
- Displays the email (the embedded image won't show)
- Dumps the error log
- Displays the PHP used
I'm sorry to bug you like this, but I find it very strange that I cannot send mail to any of the big email handlers.
Many thanks,
Dave Stewart
Last edited by davestewart on Tue May 29, 2007 4:26 am, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
The error log says it all 
Your SMTP server is for receiving mail only most likely. The other possibility is that the server requires login. Either way, the server is telling you that it will not allow you to send emails to those domains 
Code: Select all
!! Expected response code(s) [250] but got response [550 relay not permitted]-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
Hey Chris,d11wtq wrote:Your SMTP server is for receiving mail only most likely. The other possibility is that the server requires login. Either way, the server is telling you that it will not allow you to send emails to those domains
I had a chat with my mate today who surprisingly knew a fair bit about the ins and outs of email servers! According to him i need to first login to the email server before attempting to send email to anything other than the sub-network my domain is on.
Does this make sense? Is this possible to do with SwiftMailer?
If not, what is the best way forward?
Cheers,
Dave
Last edited by davestewart on Wed May 16, 2007 5:28 pm, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Easy to dodavestewart wrote:Hey Chris,d11wtq wrote:Your SMTP server is for receiving mail only most likely. The other possibility is that the server requires login. Either way, the server is telling you that it will not allow you to send emails to those domains
I had a chat with my mate today who surprisingly knew a fair bit about the ins and outs of email servers! According to him i need to first login to the email server before attempting to send email to anything other than the sub-network my domain is on.
Does this make sense? Is this possible to do with SwiftMailer?
Cheers,
Dave
Code: Select all
$smtp =& new Swift_Connection_SMTP("mail.yourdomain.tld");
$smtp->setUsername("your_username");
$smtp->setPassword("your_password");
$swift =& new Swift($smtp);-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
davestewart
- Forum Newbie
- Posts: 8
- Joined: Tue May 15, 2007 4:36 pm