Page 1 of 2
Works on Gmail, but not Yahoo
Posted: Thu Jun 21, 2007 1:37 pm
by rotwyla98
Code: Select all
require_once "mail/Swift.php";
require_once "mail/Swift/Connection/SMTP.php";
$email = $_POST['user@yahooorgmail.com'];
$swift =& new Swift(new Swift_Connection_SMTP("localhost", 25));
$message =& new Swift_Message("a html message", "text/html");
if ($swift->send($message, "$email", "admin@mysite.com"))
{
echo "An email has been sent with your link!";
}
else
{
echo "Message failed to send";
}
//It's polite to do this when you're finished
$swift->disconnect();
When the
user@yahooorgmail.com is
someone@gmail.com - the message gets sent
when it is
someone@yahoo.com - no message is sent.
I downloaded the latest version today of php4 and my server runs on php5 (when I try to run the php5 version of swiftmailer, neither email gets sent)
Any ideas?
Posted: Thu Jun 21, 2007 1:41 pm
by Chris Corbyn
Does send() return true but the message never arrives, or is send() returning false? You may be being blocked as spam but I can't say without knowing the return value of the send() method
If send() returns true, have a read over this:
http://www.swiftmailer.org/wikidocs/v3/tips/spam
Posted: Thu Jun 21, 2007 2:20 pm
by rotwyla98
Well, I did appear on the Gmail SPAM folder (will follow those tips + how do I do multipart html + plain text emails?) but I still received the message.
http://www.robtex.com/rbls/207.234.130.11.html << Not blacklisted
Swiftmailer says its successful when I send it to both yahoo and gmail but yahoo doesn't receive it at all.
Posted: Thu Jun 21, 2007 2:47 pm
by Chris Corbyn
rotwyla98 wrote:Well, I did appear on the Gmail SPAM folder (will follow those tips + how do I do multipart html + plain text emails?) but I still received the message.
http://www.robtex.com/rbls/207.234.130.11.html << Not blacklisted
Swiftmailer says its successful when I send it to both yahoo and gmail but yahoo doesn't receive it at all.
Multipart:
http://www.swiftmailer.org/wikidocs/v3/ ... /multipart
Almost definitely sounds like a spam filter problem. How short is the message you're sending? HTML-only emails do suffer too (SA calculates the ratio of text to HTML and also the ratio of images to text, in addition to checking if the text actually says the same as the HTML. Short HTML messages, especially with images in will suffer.
When you checked the blacklist did you check the IP of your SMTP server or the IP of your web server?
Posted: Thu Jun 21, 2007 4:01 pm
by rotwyla98
its a dedicated server and the ip was for mail.mydomain.com
but yes.. it is in fact that Yahoo think the message is spam. When I add my email to address book, it works great.
Here is my message code:
Code: Select all
require_once "mail/Swift.php";
require_once "mail/Swift/Connection/SMTP.php";
$swift =& new Swift(new Swift_Connection_SMTP("localhost", 25));
//Create a message
$message =& new Swift_Message("mysite.com - Free niche Guides");
//Add some "parts"
$message->attach(new Swift_Message_Part("Hey $name,/n Here is your link for the free guides!/n Please go to http://www.mysite.com/eval.php?e=$random_number to validate your email address and access your guides."));
$message->attach(new Swift_Message_Part("Hey $name,<br/>Here is your link for the free guides!<br/>Please click <a href=\"http://www.mysite.com/eval.php?e=$random_number\">HERE</a> to validate your email address and access your guides.<br/>", "text/html"));
if ($swift->send($message, "$email", "admin@mysite.com"))
What should I change/add?
Also, when I receive the email, the name shows up as "admin". Any way I can change that?
Posted: Thu Jun 21, 2007 4:15 pm
by superdezign
Posted: Thu Jun 21, 2007 5:04 pm
by Chris Corbyn
To be honest, as a human being reading what you just posted, it looks like spam. You use BLOCK CAPITALS which is a no-no (one of the many un-mentioned notes on that page I linked to), your message is one sentence long, linking to a remote website offering me something FREE...
I assume you're sending these to people who've asked for them but I suggest you think more tactfully about how you word the email. Try to bulk it out a bit for a start.
If I were a spam blocker I'd block that email personally

Posted: Thu Jun 21, 2007 7:38 pm
by rotwyla98
followed some of those tips + some additions.
Decided to get rid of the html for extra anti-spam protection.
Code: Select all
require_once "mail/Swift.php";
require_once "mail/Swift/Connection/SMTP.php";
$swift =& new Swift(new Swift_Connection_SMTP("localhost", 25));
$message =& new Swift_Message("MySite.com - Your Free Niche Guides", "Hey $name,/n
Here is your link for the free guides!\n\r Please go to http://www.mysite.com/eval.php?e=$random_number to validate your email address and access your guides.\n\r
\n\r
The above link is your personal link to verify your registration. You will then be automatically forwarded to the page with all of the guides you requested. All of these guides are written for free but cost lots of time and effort. Please be sure to vote for us (directions given on guides' page.\n\r
"));
if ($swift->send($message,new Swift_Address("$email", "$name"),new Swift_Address("admin@mysite.com", "Niche Guides"))){
echo "Thank you $name, <br>An email has been sent to $email with your link!";
}
else
{
echo "Message failed to send";
}
When I use the above code,nothing shows up on the next page + no error shows up. I inserted error_reporting (E_ALL); at the top but still no error, just a blank white page.
Posted: Fri Jun 22, 2007 2:41 am
by Chris Corbyn
You're going to cause doubled-up line breaks using \n\r.... it's actually \r\n (the ordering does matter).
Also add display_errors...
Code: Select all
error_reporting(E_ALL); ini_set("display_errors", true);
Posted: Fri Jun 22, 2007 8:25 am
by rotwyla98
I tried the code you gave me.. still didn't show any errors. Should I have safe_mode on or off?
Through a long process of commenting out code and replacing code, I found an extra parenthesis in my message
Send out the email....
the name shows up like I want it to on Gmail. Still SPAM on Yahoo.
I don't know what to do next =/
Email is not html.
I change the email address to a real one (mine) that is
user@yahoo.com and its still SPAM.
Email isn't terribly short.
Posted: Fri Jun 22, 2007 8:38 am
by Chris Corbyn
rotwyla98 wrote:I tried the code you gave me.. still didn't show any errors. Should I have safe_mode on or off?
Through a long process of commenting out code and replacing code, I found an extra parenthesis in my message
Send out the email....
the name shows up like I want it to on Gmail. Still SPAM on Yahoo.
I don't know what to do next =/
Email is not html.
I change the email address to a real one (mine) that is
user@yahoo.com and its still SPAM.
Email isn't terribly short.
It could be that you're trying to send from a Yahoo! email address when Yahoo! knows you're not sending it *from* Yahoo.com. Does your domain accept emails? Does it work if you send from an account within your own domain?
Posted: Fri Jun 22, 2007 8:56 am
by rotwyla98
So.....
When I send mail from Horde Mail on my server
==Message to yahoo is not delivered
==Message to gmail is delivered
I can accept emails.
Does that mean my servers SMTP address/domain is blacklisted?
EDIT: Did some more testing. Created a mail account on another one of my domains on the same IP, email still doesn't go through to Yahoo but does to Gmail.
Posted: Fri Jun 22, 2007 11:01 am
by Chris Corbyn
Is it the same email you're trying to send? Maybe the email content is sniffed at by Yahoo. If Horde can't send to Yahoo and your other domain still doesn't work I'd be looking at your email wording. Words like "Hey <user>" and "FREE something" make emails look spammy.
Posted: Fri Jun 22, 2007 11:53 am
by rotwyla98
well.. its definitely my servers ip.
I fixed up the message body.
I copied all the code to another server and it sent email successfully to gmail, yahoo, and hotmail.
Try on mine, doesn't work.
Thanks for all of your help.
Posted: Fri Jun 22, 2007 1:45 pm
by Chris Corbyn
Would you like to PM me your IP? I may be able to help you figure out the problem and offer some guidance for correcting it. Sometimes the stupidest things can cause huge problems. No promises though
