Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $to = 'email@example.com';
- $from = 'email@example.com';
- $subject = 'test subject';
- $module = '';
- $token = time();
- $message = array(
- 'id' => $module . '_' . $token,
- 'to' => $to,
- 'subject' => $subject,
- 'body' => array(
- "example body"
- ),
- 'headers' => array(
- 'From' => $from,
- 'Sender' => $from,
- 'Return-Path' => $from,
- 'MIME-Version' => '1.0',
- 'Content-Type' => 'text/plain; charset=UTF-8',
- ),
- 'params' => array(
- // 'attachments' => array(
- // 0 => array(
- // 'path' => "public://invites/test.ics",
- // 'filecontent' => "",
- // 'filename' => "test.txt",
- // 'mime' => "text/plain",
- // 'encoding' => 'base64',
- // 'disposition' => 'attachment',
- // //'list' => TRUE,
- // ),
- // ),
- ),
- );
- $system = drupal_mail_system($module, $token);
- $message = $system->format($message);
- if ($system->mail($message)) {
- print "sent";
- }
- else {
- print "not sent";
- }
Add Comment
Please, Sign In to add comment