AXheladini AXheladini - 3 months ago 7
PHP Question

Advance PHP mail script

I have created an php mail script, And in the message of the mail i sent i am using many variables (data). For example i want to sent an mail with this body msg:

Name: Somename

Email: someemail@somwhere.com

City: Somecity

State: somestate

.........

What i am doing is this:


$msg = "Name: $name (brake) Email: $email (brake)......"


this message is not working in major emails like gmail, hotmail, yahoo...
I get the mail with html tags and i dont want that.

There must be some other way to do this so my mail structure looks good on every email account ?

Answer

Make sure in the header declarations you are declaring it as an HTML e-mail.

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"

http://php.net/manual/en/function.mail.php should help out as well. Follow the example code in there and it's guaranteed to work.

Comments