[development] Drupal Mail API Problem

Randy Fay randy at randyfay.com
Thu Jul 21 16:01:52 UTC 2011


I think the email_example in the Examples project demonstrates this, but I'm
not sure.

http://drupal.org/project/examples

-Randy

On Thu, Jul 21, 2011 at 7:29 AM, Reka Sandaruwan
<rekasandaruwan at gmail.com>wrote:

> 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
>



-- 
Randy Fay
Drupal Module and Site Development
randy at randyfay.com
+1  970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110721/6812d98f/attachment-0001.html 


More information about the development mailing list