[development] Drupal Mail API Problem

Reka Sandaruwan rekasandaruwan at gmail.com
Thu Jul 21 13:29:35 UTC 2011


I want to sent mail using drupal mail api. i can send mail using sender mail
as site mail , no problem it is working.
<<  $site_mail = variable_get('site_mail', ini_get('sendmail_from'));
        $from = $site_mail;
        drupal_mail($module, $key, $to, $language, $params, $from, TRUE);
>>

But I want to send mail using sender mail as different one (custom mail
address), at this point mail did not send
<<  $site_mail = "sjrooms at olsen.tdcadsl.dk" <sjrooms at olsen.tdcadsl.dk>;
        $from = $site_mail;
        drupal_mail($module, $key, $to, $language, $params, $from, TRUE);
>>

I cant understand this problem. what can I do for this?.


I have another problem, is our mail server block send mail to multiple
revisers because i cant same send mail to 2 revisers.
<<  $site_mail = variable_get('site_mail', ini_get('sendmail_from'));
       $user_mail = $form['contact_form']["email"]['#value'];
       $to = $user_mail.",".$site_mail;
       drupal_mail($module, $key, $to, $language, $params, $from, TRUE);
>>

"I was try as :
                $to The e-mail address or addresses where the message will
be sent to. The formatting of this string must comply with RFC 2822.
Some  examples are:

   - user at example.com
   - user at example.com, anotheruser at example.com
   - User <user at example.com> <user at example.com>
   - User <user at example.com> <user at example.com>, Another User
   <anotheruser at example.com> <anotheruser at example.com>  "


*I was followed the following guide*.
http://api.drupal.org/api/drupal/includes--form.inc/group/form_api/7
http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/7

-- 
Sandaruwan
http://openmindsl.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110721/9b4a4a80/attachment.html 


More information about the development mailing list