hi,
nice to meet you,
actually I am suffering with HTML. I am making a application for newsletter all the codes are works but images cannot display and its comes like link break, even I use ur coding as it is, but still same here below I say some dtails.
PHP Code:
$subject = 'testing';
$message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<table width="500px"b border="1">
<tr bgcolor="#0099FF">
<td width="50%"> Name </td><td width="25%"> Age </td> <td width="25%"> Rank </td>
</tr>
<tr bgcolor="#FFFF99">
<td> </td>
<td> </td> <td> </td>
</tr>
<tr>
<td></td><td width="100%"><img src="http://alnjoum.net/img/newsletter/images/gdr.jpg" width="500px" height="350px"/></td><td></td>
</tr>
</table>
</body>
</html>
';
$to = 'someone <someone @somehwhere.co.uk>';
$headers = "From: you <[email protected]>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Reply-to: you <[email protected]>\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion()."\n";
if(mail($to, $subject, $message, $headers)){
//success
}else{
//error
}
this all above works and image with links (maps also) are working.
but when I use variable for take the html stuff from the Form so it cant, here below my code with Form.
PHP Code:
<?php
$headers = "[email protected]";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Reply-to: Me <[email protected]>\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion()."\n";
$subject = $_POST['subj'];
$message = $_POST['msg'];
$to = '[email protected]';
if(mail($to, $subject, $message, $headers)){
echo 'sent successfully'; //success
}else{
echo 'some error.';//error
}
?>
<form action="try.php" method="post">
subject : <input type="text" name="subj"><br />
Message : <textarea name="msg" cols="60" rows="5"></textarea> <br />
<input type="submit" name="submit" value="submit">
</form>