Site5 - Built For Designers & Developers MENU

Why do emails sent with PHP mail() with html tags not get sent?

[2 Grey Star Level]

Hi,
I have a problem with my php mail() function. At the moment, I have this

$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=utf-8’ . “\r\n”;
$headers .= ‘From: Stikprøve support ‘ . “\r\n”;
$headers .= ‘Reply-To: Stikprøve support ‘ . “\r\n”;
$email_subject = “Du er blevet oprettet på stikprøve.dk”;

and then a message

$email_message .= ‘

Answer #1

Hello! I am sorry to hear you are having a problem with the php mail function. I just ran a test on one of our servers with the following code and it seamed to work.

$to = ‘john@smith.com’;

$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=utf-8’ . “\r\n”;
$headers .= ‘From: Name ‘ . “\r\n”;
$headers .= ‘Reply-To: Name ‘ . “\r\n”;
$subject = ‘Subject Line’;
$message .= ‘Body goes here! — HTML Code works here :)’;

mail($to,$subject, $message, $headers);

If you don’t mind, could you try running that code on your server to see if it works? If it does, then you can simply modify it so that it works with your needs, otherwise, please contact our support department so that we can find out whats going on.

Answers Answered By: joliver [476 Blue Star Level]

Answer #2

Hi Joliver, thanks a lot, this helped me. I got it to work….
Kasper

Answers Answered By: Cubanpete [2 Grey Star Level]

Answer this Question

You must be Logged In to post an Answer.

Not a member yet? Sign Up Now »

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.