Forums: How to Send HTML email - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to Send HTML email HTML Email Help

#1 User is offline   marketingsolutions 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 03-February 10

Posted 03 February 2010 - 04:05 PM

On using the trial version today, I wanted to be able to send out HTMl emails to clients once they had agreed our terms of contract.

I looked though the forum but could not find a full answer, so to help out anyone else searching, below you will find what you need to enter into

Events >> Add Page >> After record added

$to = "email@address.com";
$subject = "Subject Line Goes Here";

$message = "
<html>
<head>
<title>Title Line Goes Here</title>
</head>
<body>
<table width=\"778\" border=\"0\" cellspacing=\"10\" cellpadding=\"10\" style=\"border:1px dashed #DFF2F6;\">
  <tr>
    <td>
<h2>Email Page Title Goes Here</h2>

<p>I <strong>".$values["name"]."</strong> representing <strong>".$values["Companyname"]."</strong> confirm I have read and understood and agree  to these terms of payment and wish for you to start work on this project.</p>
<p> I have received and will pay the invoice for the project  value in order to action the contract.</p>
<p> I understand that work will commence on this contract  once payment has cleared.</p>
<table border=\"0\" width=\"600\" cellspacing=\"10\" cellpadding=\"0\">
  <tr>
    <td valign=\"top\">Address:</td>
    <td valign=\"top\">".$values["address"]."</td>
  </tr>
  <tr>
    <td valign=\"top\">Signed: </td>
    <td valign=\"top\">".$values["signed"]."</td>
  </tr>
  <tr>
    <td valign=\"top\">Name: </td>
    <td valign=\"top\">".$values["name2"]."</td>
  </tr>
  <tr>
    <td valign=\"top\">Position: </td>
    <td valign=\"top\">".$values["position"]."</td>
  </tr>
  <tr>
    <td valign=\"top\">Date:</td>
    <td valign=\"top\">".$values["datetime"]."</td>
  </tr>
</table>
<br></td>
  </tr>
</table>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";// More headers
$headers .= 'From: email@address.com' . "\r\n";
mail($to,$subject,$message,$headers);


I hope this helps.

If any code is wrong in this then please let me know
0

#2 User is offline   Pavel Nefyodov 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 27-January 10
  • Gender:Male
  • Location:Lancashire
  • Interests:Golf, cricket.

Posted 04 February 2010 - 01:41 PM

Please try this code in PHPRunner 5.1:
$email="your.email@your.com";// your email, please change
$msg="";
$msg.="<html> 
<head> 
<title>Title Line Goes Here</title> 
</head> 
<body> 
<table width=\"778\" border=\"0\" cellspacing=\"10\" cellpadding=\"10\" style=\"border:1px dashed #DFF2F6;\"> 
  <tr> 
    <td> 
<h2>Email Page Title Goes Here</h2> 
 
<p>I <strong>".$values["name"]."</strong> representing <strong>".$values["Companyname"]."</strong> confirm I have read and understood and agree  to these terms of payment and wish for you to start work on this project.</p> 
<p> I have received and will pay the invoice for the project  value in order to action the contract.</p> 
<p> I understand that work will commence on this contract  once payment has cleared.</p> 
<table border=\"0\" width=\"600\" cellspacing=\"10\" cellpadding=\"0\"> 
  <tr> 
    <td valign=\"top\">Address:</td> 
    <td valign=\"top\">".$values["address"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Signed: </td> 
    <td valign=\"top\">".$values["signed"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Name: </td> 
    <td valign=\"top\">".$values["name2"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Position: </td> 
    <td valign=\"top\">".$values["postion"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Date:</td> 
    <td valign=\"top\">".$values["datetime"]."</td> 
  </tr> 
</table> 
<br></td> 
  </tr> 
</table> 
</body> 
</html> 
"; 

$subject="Confirmation";

$from="admin@test.com";


$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'htmlbody' => $msg, 'from'=>$from));// Note 'htmlbody' instead of 'html'!
if(!$ret["mailed"])
{echo $ret["message"];}


P.S. Please do check spelling. "$values["postion"]" doesn't look right to me.
0

#3 User is offline   ninemins 

  • Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 05-February 10

Posted 09 February 2010 - 09:27 AM

Thanks guys was this code workin and verified

Cheers Chris

View PostPavel Nefyodov, on 04 February 2010 - 01:41 PM, said:

Please try this code in PHPRunner 5.1:
$email="your.email@your.com";// your email, please change
$msg="";
$msg.="<html> 
<head> 
<title>Title Line Goes Here</title> 
</head> 
<body> 
<table width=\"778\" border=\"0\" cellspacing=\"10\" cellpadding=\"10\" style=\"border:1px dashed #DFF2F6;\"> 
  <tr> 
    <td> 
<h2>Email Page Title Goes Here</h2> 
 
<p>I <strong>".$values["name"]."</strong> representing <strong>".$values["Companyname"]."</strong> confirm I have read and understood and agree  to these terms of payment and wish for you to start work on this project.</p> 
<p> I have received and will pay the invoice for the project  value in order to action the contract.</p> 
<p> I understand that work will commence on this contract  once payment has cleared.</p> 
<table border=\"0\" width=\"600\" cellspacing=\"10\" cellpadding=\"0\"> 
  <tr> 
    <td valign=\"top\">Address:</td> 
    <td valign=\"top\">".$values["address"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Signed: </td> 
    <td valign=\"top\">".$values["signed"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Name: </td> 
    <td valign=\"top\">".$values["name2"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Position: </td> 
    <td valign=\"top\">".$values["postion"]."</td> 
  </tr> 
  <tr> 
    <td valign=\"top\">Date:</td> 
    <td valign=\"top\">".$values["datetime"]."</td> 
  </tr> 
</table> 
<br></td> 
  </tr> 
</table> 
</body> 
</html> 
"; 

$subject="Confirmation";

$from="admin@test.com";


$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'htmlbody' => $msg, 'from'=>$from));// Note 'htmlbody' instead of 'html'!
if(!$ret["mailed"])
{echo $ret["message"];}


P.S. Please do check spelling. "$values["postion"]" doesn't look right to me.

0

#4 User is offline   marketingsolutions 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 03-February 10

Posted 09 February 2010 - 09:46 AM

I have this working with no problems on my system
0

#5 User is offline   alandob 

  • Member
  • PipPip
  • Group: Members
  • Posts: 19
  • Joined: 27-January 10

Posted 09 February 2010 - 10:20 AM

How can you send these HTML emails if you need SMTP authentication.

I use windows server 2003 with XAMPP (MySQL, PHP, PEAR, Perl with mod_perl & Apache) and need to send emails with SMTP Authenticaton. I have read some of the previous postings with details how to use with PEAR but the settings using XAMPP now do not have the same file settings (the posts may be outdated now http://www.asprunner..._fromsearch__1) for example XAMPP doesnt have class.phpmailer.php & class.smtp.php files now.

Any help would be appreciated.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users