applicat Posted July 1, 2003 Posted July 1, 2003 I set up a simple php script to test the mail() function, but I can't get it to send. ><? mail("recipient@domain2.com", "Test Subject", "Body Line 1\n Body Line 2\n Body Line 3", "From: sender@domain1.com"); ?> It will work if the recipient is the same as the sender, but if sent to a different domain, the message never arrives. Here are a couple of header lines from the message received on the same domain. Received: from nobody by server17.totalchoicehosting.com From: sender@domain1.com Any ideas? Quote
surefire Posted July 1, 2003 Posted July 1, 2003 I doubt this is the reason... but you should open up your php with <?php Looking at your code, I can't think of a reason it wouldn't work. You might want to send a help ticket if no one else can figure out. If mail didn't work at all, I'd say there's something wrong with the code. But if you aren't getting error messages but you're getting the quirk you explained, then I'd send a help ticket. I had a strange quirk with my email and it had to be resolved by the Help Desk. Quote
applicat Posted July 1, 2003 Author Posted July 1, 2003 Okay, I guess the original code worked okay, but it took over an hour to receive the message. How can I speed up the PHP mail() delivery from my TCH domain? Quote
TCH-Andy Posted July 1, 2003 Posted July 1, 2003 We've done a few tweaks on the server to try and improve things, but from the tests I've done, if you include all the headers, the mail goes out almost instantaniously. If you don't include the headers, it either takes forever or gets lost along the way. I havn't done a selective test to determine which are the most significant headers to include - I just include the lot :-) Andy. Quote
surefire Posted July 2, 2003 Posted July 2, 2003 The other suggestion I have which is sure to work is to get a script that allows you to send email through smtp or mime... whichever you choose. Plenty out there. You'll find quite a few at hotscripts.com The mail() function works well, but you get more functionality and faster delivery through mime or smtp. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.