Send Html Newsletter with php through mail Function.

<?php

$a=$_POST["nemail"];

if($ret)
{
//header("location:newsletter.php");
$to = $a;

// subject
$subject = 'Thank you For Subscribe your Domain name NewsLetter';

// message
$message = '<table width="100%" border="0" cellspacing="0" cellpadding="3" style="font-family:Trebuchet MS, Arial, Helvetica, sans-serif; font-size:12px; border:#F63 1px solid;">
  <tr style="background:url(http://your Domain name /images/second_bg.png) 52% 50% no-repeat #1D0100;height:180px;">
    <td align="center" height="105" width="161"><img src="http://your Domain name /images/logo.png" height="105" width="161" border="0" /></td>
  </tr>
  <tr>
    <td><table width="70%" border="0" align="center" cellpadding="3" cellspacing="0" style="font-family:Trebuchet MS, Arial, Helvetica, sans-serif; font-size:12px;">
      <tr>';

       $message.= '<td>Hello</td>';

      $message.='</tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Thank you For Subscribe your Domain name  NewsLetter <strong>your Domain name </strong></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Thanks &amp; regards<br>
          <br>
          <strong>your Domain name </strong><br>
          <strong>Email:</strong>mail id which is used for mail sending<br>
          <strong>Website:</strong> <a href="your Domain name /">your Domain name </a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" style="background-color:#333; color:#FFF;">Tuliphitech.com</td>
  </tr>
</table>';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From: your Domain name <mail id which is used for mail sending>' . "\r\n";

// Mail it

mail($to, $subject, $message, $headers);
echo "<script>
alert('Thanks for Subcribe our News-Letter');
window.location.replace(\"http://tuliphitech.com/index.php\");
</script>";
}
else
{

}
?>

Popular posts from this blog

Simple Sign up design. Android.

Cart page design in android.

Set Date on jDateChooser and retrieve record from database.