<?php
/*
*
* General mailing framework
*
*/
class Mail
{
var $emailId;
var $name;
var $contact;
var $message;
var $to;
var $subject;
var $headers;
function Mail($credentials)
{
$this->__construct($credentials);
}
function __construct($credentials)
{
$this->emailId = $credentials['email'];
$this->name = $credentials['name'];
$this->contact = $credentials['contact'];
$this->subject = $credentials['subject'];
$this->setMessage($credentials);
$this->to = $credentials['to'];
$this->setHeaders();
}
function sendMail()
{
mail($this->to, $this->subject, $this->message, $this->headers);
}
function setHeaders()
{
$this->headers = 'MIME-Version: 1.0' . "\r\n";
$this->headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$this->headers .= "From: Travel site";
}
function setMessage($credentials)
{
$this->message = "<style>
<!--
/* Font Definitions */
@font-face
{font-family:'Cambria Math';
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:1;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:'';
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:'Times New Roman','serif';
mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-noshow:yes;
mso-style-priority:99;
color:purple;
text-decoration:underline;
text-underline:single;}
span.EmailStyle17
{mso-style-type:personal;
mso-style-noshow:yes;
mso-style-unhide:no;
font-family:'Calibri','sans-serif';
mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri;
color:#1F497D;}
span.EmailStyle18
{mso-style-type:personal;
mso-style-noshow:yes;
mso-style-unhide:no;
font-family:'Calibri','sans-serif';
mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:'Table Normal';
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:'';
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:'Times New Roman','serif'}
</style>
<![endif]-->";
$this->message .= "<table class=MsoNormalTable border=1 cellspacing=1 cellpadding=0 width=500
style='width:375.0pt;mso-cellspacing:.7pt;background:#CCCCCC;mso-yfti-tbllook:
1184;mso-padding-alt:0in 0in 0in 0in'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes' align='center'>
<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt' colspan='2'><img src='http://" .
($_SERVER['HTTP_HOST']) . "/images/faixa.jpg' />
</td>
</tr>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes' align='center'>
<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt' colspan='2'><h3>" . $this->subject . "</h3>
</td>
</tr>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Name:<o:p></o:p></span></b></p>
</td>
<td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $this->name . "<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:2'>
<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Contact:<o:p></o:p></span></b></p>
</td>
<td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $this->contact . "<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:2'>
<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Email:<o:p></o:p></span></b></p>
</td>
<td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $this->emailId . "<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:2'>
<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Message:<o:p></o:p></span></b></p>
</td>
<td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $credentials['message'] . "<o:p></o:p></span></p>
</td>
</tr>
</table>";
}
}
?>