veluit06 Posted February 27, 2009 Share Posted February 27, 2009 hi i want to send my images using mail to syntax, below is my code $body = "<img src='amma.jpg'>" ; mail($to, $subject, $body, $headers) in our mail we have to receive images only not that path... Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/ Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 put the image on a webserver, then use the FULL url: $body = "<img src='http://www.yourserver.com/images/amma.jpg'>" ; Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772555 Share on other sites More sharing options...
veluit06 Posted February 27, 2009 Author Share Posted February 27, 2009 hi thanku for your rpy http://www.mittaai.com/amma/ please enter the fields and check your mail then you can able to c the needs here v got only image link, but v want a image please fill the form and check your mail Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772559 Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 you need to send an HTML email by passing a content type in your headers: $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; Check out Example #4 here: http://us.php.net/manual/en/function.mail.php Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772563 Share on other sites More sharing options...
veluit06 Posted February 27, 2009 Author Share Posted February 27, 2009 Below is my full code here where i have to give this content code.... tel me the correct solution please <?php $operation = $_GET['Opr']; $name=$_GET['name']; $email=$_GET['email']; $address=$_GET['address']; $wish=$_GET['wish']; $from = "Maruvathooramma.blogspot Team"; $to = $_GET['email']; $subject = "Thankyou For Your Amma Birthday Wishes"; $body = "<img src='http://www.onlinepcsecure.com/amma/amma.jpg'>" ; $headers = "From: $from"; $temp = 0; if($operation=="saveAmmaWish") { $con = mysql_connect("localhost","name","pass"); mysql_select_db("mittaai_mittai", $con) or die( "Unable to select database"); $query = "INSERT INTO ammawish (name, email, address, wish) VALUES ('$name', '$email', '$address', '$wish')"; mysql_query($query); mysql_close(); if (mail($to, $subject, $body, $headers)) echo ("Thankyou, For Your Wishes"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772583 Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 Next, use code tags. Just click the button with the # on it, and put your code between the tags it inserts. <?php $operation = $_GET['Opr']; $name=$_GET['name']; $email=$_GET['email']; $address=$_GET['address']; $wish=$_GET['wish']; $from = "Maruvathooramma.blogspot Team"; $to = $_GET['email']; $subject = "Thankyou For Your Amma Birthday Wishes"; $body = "<img src='http://www.onlinepcsecure.com/amma/amma.jpg'>" ; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $from\r\n"; $temp = 0; if($operation=="saveAmmaWish") { $con = mysql_connect("localhost","name","pass"); mysql_select_db("mittaai_mittai", $con) or die( "Unable to select database"); $query = "INSERT INTO ammawish (name, email, address, wish) VALUES ('$name', '$email', '$address', '$wish')"; mysql_query($query); mysql_close(); if (mail($to, $subject, $body, $headers)) echo ("Thankyou, For Your Wishes"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772589 Share on other sites More sharing options...
veluit06 Posted February 27, 2009 Author Share Posted February 27, 2009 thankyou friend thankyou for your support..... check now the form and your mail..... its coming thanku very much veluit06@gmail.com this is my mail id ......... you can contact me any time Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772592 Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 your welcome. don't forget to hit Topic Solved, it's in the very bottom left corner of the thread Quote Link to comment https://forums.phpfreaks.com/topic/147163-solved-sending-images-through-php-mail-concept/#findComment-772595 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.