Ejemplo n.º 1
0
 public function SendMessage()
 {
     // Set debug mode
     //QEmailServer::$TestMode = true;
     //QEmailServer::$TestModeDirectory = __DOCROOT__ . '/../file_assets/emails';
     QEmailServer::$SmtpServer = SMTP_SERVER;
     // Create a new message
     // Note that you can list multiple addresses and that Qcodo supports Bcc and Cc
     $objMessage = new QEmailMessage();
     $objMessage->From = 'Carisa Hamilton <*****@*****.**>';
     $objMessage->To = $this->objGroupRegistration->Email;
     $objMessage->Bcc = '*****@*****.**';
     $objMessage->Subject = 'Invitation to Growth Groups';
     // Setup Plaintext Message
     $strBody = "Hello " . $this->objGroupRegistration->FirstName . "!\r\n\r\n";
     $strBody .= 'We are very excited that you are interested in facilitating a Growth Group! \\r\\nAttached is a ' . 'facilitator application we ask all potential facilitators to complete. \\r\\n' . 'Please fill it out and send it back to me via email (carisa.hamilton@alcf.net). \\r\\nYou may also fax ' . 'it to the church office at 650-625-1500 or drop it off in the All Forms Box at the worship ' . 'center. \\r\\nOnce we receive your application, Pastor John will follow up with you for a short ' . 'interview.\\r\\n';
     $strBody .= 'If you have any questions or concerns please feel free to contact me.\\r\\n\\r\\n';
     $strBody .= 'Blessings,\\r\\n Carisa';
     $objMessage->Body = $strBody;
     // Also setup HTML message (optional)
     $strBody = "Hello " . $this->objGroupRegistration->FirstName . "!<br><br>";
     $strBody .= 'We are very excited that you are interested in facilitating a Growth Group! <br>Attached is a ' . 'facilitator application we ask all potential facilitators to complete. <br>' . 'Please fill it out and send it back to me via email (carisa.hamilton@alcf.net). <br>You may also fax ' . 'it to the church office at 650-625-1501 or drop it off in the All Forms Box at the worship ' . 'center. <br>Once we receive your application, Pastor John will follow up with you for a short ' . 'interview.<br><br>';
     $strBody .= 'If you have any questions or concerns please feel free to contact me.<br><br>';
     $strBody .= 'Blessings,<br> Carisa';
     $objMessage->HtmlBody = $strBody;
     // Add the attachment
     $objFile = new QEmailAttachment(__DOCROOT__ . '/../file_assets/FacilitatorApplication.doc');
     $objMessage->AddAttachment($objFile);
     // Add random/custom email headers
     $objMessage->SetHeader('x-application', 'Growth Groups Ministry');
     QEmailServer::Send($objMessage);
 }
Ejemplo n.º 2
0
$objMessage->To = 'John Doe <*****@*****.**>, Jane Doe <*****@*****.**>';
$objMessage->Bcc = '*****@*****.**';
$objMessage->Subject = 'Report for ' . QDateTime::NowToString(QDateTime::FormatDisplayDate);
// Setup Plaintext Message
$strBody = "Dear John and Jane Doe,\r\n\r\n";
$strBody .= "You have new reports to review.  Please go to the ACME Portal at http://portal.acme.com/ to review.\r\n\r\n";
$strBody .= "Regards,\r\nACME Reporting Service";
$objMessage->Body = $strBody;
// Also setup HTML message (optional)
$strBody = 'Dear John and Jane Doe,</p>';
$strBody .= '<strong>You have new reports to review.</strong>  Please go to the <a href="http://portal.acme.com/">ACME Portal</a> to review.</p>';
$strBody .= 'Regards,<br/><strong>ACME Reporting Service</strong>';
$objMessage->HtmlBody = $strBody;
// Add random/custom email headers
$objMessage->SetHeader('x-application', 'ACME Reporting Service v1.2a');
// Add a text file attachment (you can also send non-text attachments with QEmailAttachment)
$strAttachmentContents = "This is the text file's contents";
$objAttachment = new QEmailStringAttachment($strAttachmentContents, QMimeType::PlainText, "attachment.txt");
$objMessage->AddAttachment($objAttachment);
// Send the Message (Commented out for obvious reasons)
//	QEmailServer::Send($objMessage);
// Note that you can also shortcut the Send command to one line for simple messages (similar to PHP's mail())
$strBody = "Dear John and Jane Doe,\r\n\r\n";
$strBody .= "You have new reports to review.  Please go to the ACME Portal at http://portal.acme.com/ to review.\r\n\r\n";
$strBody .= "Regards,\r\nACME Reporting Service";
//	QEmailServer::Send(new QEmailMessage('*****@*****.**', '*****@*****.**', 'Alerts Received!', $strBody));
?>
</div>

<?php 
require '../includes/footer.inc.php';