Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail & PHP form data

Status
Not open for further replies.

UBfoolin

Programmer
Nov 29, 2001
32
US
I have a form where an email address is entered, then used with the MAIL command to send the email. Most of the time it works, sometimes it does not.

To debug, I use the following 3 commands:

Test 1). mail('a@cnn.com','Test1','*'.$return['email'].'*',$hdrs);
Test 2). mail('a@cnn.com','Test2',bin2hex($return['email']),$hdrs);
Test 3). mail('a@cnn.com','Test3',strlen($return['email']),$hdrs);

For reference, the mail command syntax is: mail(to,subject,message,headers,parameters)

When the email address is mike@yahoo.com, I get incorrect results where only Test2 and Test3 emails are received.
Test 1). No email is ever received
Test 2). The body is the 14 ASCII codes: 6d696b65407961686f6f2e636f6d
Test 3). The email body is: 14

When the email address is mike2@yahoo.com, I get correct results with the following 3 emails:
Test1). The email body is: *mike2@yahoo.com*
Test 2). The body is the 15 ASCII codes: 6d696b6532407961686f6f2e636f6d
Test 3). The email body is: 15

When the email address is mike@yahoo.comx, I get incorrect results with the following 2 emails:
Test 1). No email is ever received
Test 2). The body is the 14 ASCII codes: 6d696b65407961686f6f2e636f6d78
Test 3). The email body is: 15

When the email address is 1234567890@1234567890.123456, I get correct results with the following 3 emails:
Test 1). The email body is: *1234567890@1234567890.123456*
Test 2). The body is the 14 ASCII codes: 3132333435363738393040313233343536373839302e313233343536
Test 3). The email body is: 28

What is causing the 2 emails to not be sent? I need to reliably collect and use the email address entered on the form.
 
how do you know that the emails are not being sent?

Most of the time issues such as yours relate to emails not being received. i.e. one of the interstitial servers are filtering and junking the message. Sometimes without telling either the recipient or the sender.

since sometimes emails are being sent; the occam's razor analysis is very probable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top