Jump to content

[SOLVED] HTML Email !


d.shankar

Recommended Posts

Hi all.

 

I got this email script and it really irritates me a lot.

 

I need this email to be sent in html format.

When opened it should display the image and other formattings.

But nothing is working it seems.

 

I have tried this mail by sending to my gmail and it shows the image but i am not able to see the image in any other email accounts.. say yahoo,hotmail,webmail...etc

 

 

Here is the php email script

 

<?php


$to="me@gmail.com";
$subject="testing";
$message="<img src='http://l.yimg.com/t/img/new_in_fp_logo.gif'><br>This is a mail from yahoo india<br>";

$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; 
$headers .= "\nMIME-Version: 1.0\n" . 
            "Content-Type: multipart/mixed;\n" . 
            " boundary=\"{$mime_boundary}\""; 
            
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n"; 
$headers .= "X-Mailer: PHP v".phpversion()."\r\n";  
    	 
$message .= "This is a multi-part message in MIME format.\n\n" . 
                "--{$mime_boundary}\n" . 
                "Content-Type:text/html; charset=\"iso-8859-1\"\n" . 
               "Content-Transfer-Encoding: 7bit\n\n" . 
			$message . "\n\n"; 

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

?>

 

Can someone help me out ?

Link to comment
Share on other sites

I am sorry to say that it isnt working

 

Here is the code... :(

 

<?php
ini_set("sendmail_from", "The Yahoo Team <support@yahoo.com>");

$to="myself@gmail.com";
$subject="testing1";
$message="<img src='http://l.yimg.com/t/img/new_in_fp_logo.gif'><br>This is a mail from yahoo india<br>";

$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; 
$headers .= "\nMIME-Version: 1.0\n" . 
            "Content-Type:text/html; charset=\"iso-8859-1\"\n" . 
            " boundary=\"{$mime_boundary}\""; 

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

?>

 

 

Link to comment
Share on other sites

I have shortened down the code... it still works from my localhost , but it does not work in from my live server.

 

<?php
ini_set("sendmail_from", "The Yahoo Team <support@yahoo.com>");
$to="myself@gmail.com";
$subject="testing1";
$message="<img src='http://l.yimg.com/t/img/new_in_fp_logo.gif'><br>This is a mail from yahoo india<br>";
$headers .= "\nMIME-Version: 1.0\n"."Content-Type:text/html; charset=\"iso-8859-1\"\n"; 
mail($to,$subject,$message,$headers);
?>

 

 

Please somebody help  :'(

Link to comment
Share on other sites

Try this:

<?php
error_reporting(E_ALL);
ini_set("sendmail_from", "The Yahoo Team <support@yahoo.com>");

$to = "myself@gmail.com";
$subject = "testing1";
$message = "<img src='http://l.yimg.com/t/img/new_in_fp_logo.gif' /><br />This is a mail from yahoo india<br />";

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

if(mail($to,$subject,$message,$headers)){
//It was sent!
echo "Mail has been sent!";
}else{
//Failed to send mail...
echo "Mail was not sent!";
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.