Hi everyone.
I’m trying to put together gallery where you would choose a picture, fill in a form with some data (name, email, recipient and message) and receive somehow formatted e-card via html mail (I don’t want to send just a link).
[php]
$email_from = "[email protected]";
$email_subject = “E-card has just been sent by user $name”;
$ecard = "
[code]
$name has sent you this e-card
$name
This email has been generated automatically using <b>
<a style=\"color:#C7EDF2\" href=\"http://domain.com\">
Send ecard service</a></b><br>
Reply to this message will be automatically redirected to sender's e-mail address
($visitor_email)<br>
Some footer
$to = “$rec_email”;
$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=utf-8’ . “\r\n”;
//$boundary = uniqid(‘np’);
$headers .= “From: $email_from\n”;
$headers .= “Reply-To: $visitor_email\n”;
//$headers .= “Content-Type: multipart/alternative;boundary=” . $boundary . “\r\n”;
//$email_body .= “\r\n\r\n–” . $boundary . “\r\n”;
//$email_body .= “Content-type: text/html;charset=utf-8\r\n\r\n”;
$email_body = “$ecard”;
//$email_body .= “\r\n\r\n–” . $boundary . “\r\n”;
//$email_body .= “Content-type: text/plain;charset=utf-8\r\n\r\n”;
//$email_body .= “$plain”;
//$email_body .= “\r\n\r\n–” . $boundary . “–”;
mail($to, $email_subject, $email_body, $headers);[/php]
Everything seemed to work fine until I started testing different e-mail clients. In my webmail, the card arrived looking exactly as I intended. With other clients, the things weren’t so smooth.
In Gmail, I see just blank message - no pictures, no text, nothing…
In Outlook, I can see the pictures (correctly formatted) but I can’t see any text
I have commented out some other functionality which I thought might have been causing the problem but I still can’t display card correctly. Tried to search the web but didn’t get solution.
Anyone has an idea how to solve the problem?
Thanks in advance