Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Mail & PHP form data – inconsistent results

the mail() function

Moderators: macek, egami, gesf

Mail & PHP form data – inconsistent results

Postby UBfoolin » Sat Nov 19, 2011 11:43 am

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).
Code: Select all
mail('a@cnn.com','Test1','*'.$return['email'].'*',$hdrs);

test 2).
Code: Select all
mail('a@cnn.com','Test2',bin2hex($return['email']),$hdrs);

test 3).
Code: Select all
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.
UBfoolin
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sat Nov 19, 2011 11:38 am

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron