Jump to content

[SOLVED] sending images through php mail concept


veluit06

Recommended Posts

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

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");

 

 

}

 

 

?>

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");
   

}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.