Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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?

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...