- function sendEmailSendGrid($subject, $message, $to, $rid, $nid){
-
- $to = trim($to);
-
- $htmlMessage = "<html><body>".$message."</body></html>";
-
- $host = "smtp.sendgrid.net";
- $port = "587";
- $username = "username";
- $password = "password";
-
- $crlf = "\n";
-
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
-
- $from='junk@junk.com';
-
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject,
- 'Content-type' => 'text/html; charset=iso-8859-1');
-
- $mail = $smtp->send($to, $headers, $htmlMessage);
- if (PEAR::isError($mail)) {
- echo("<p>" . $mail->getMessage() . "</p>");
- } else {
- echo("<p>Message successfully sent to: ".$to."</p>");
- }
- }
function sendEmailSendGrid($subject, $message, $to, $rid, $nid){
$to = trim($to);
$htmlMessage = "<html><body>".$message."</body></html>";
$host = "smtp.sendgrid.net";
$port = "587";
$username = "username";
$password = "password";
$crlf = "\n";
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$from='junk@junk.com';
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject,
'Content-type' => 'text/html; charset=iso-8859-1');
$mail = $smtp->send($to, $headers, $htmlMessage);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent to: ".$to."</p>");
}
}
No comments:
Post a Comment