Hello,

I have enabled PHPMailer, Mime Mail and Previewable Email Templates. I am able to create an email template (Structure >> Previewable Email Templates), to preview it and to successfully send it using the button on the Preview screen. However, when I call this from the API as

pet_send_mail('my_template_name', 'toAddress@mymail.com', 'fromAddress@mymail.com');

nothing happens.
I have also created a hook_mail() function and used drupal_mail() to send mails from this function, and this works. Yet for some reason neither pet_send_mail() nor pet_send_one_mail() seem to work.
Any suggestions on what the issue might be or what to check (and how) would be welcome. Drupal is fairly new to me, so not sure if I am overlooking something quite simple.

Comments

Eterra’s picture

I am not sure why, but the log report triggered by the pet_send_mail() function shows that there is no recipient for the message. I have included this as a hard coded text string 'toAddress@mymail.com' as one of the arguments of the pet_send_mail() function. Any ideas why the recipient is not being picked up by the function?

Eterra’s picture

Looks like the $recipients is expecting an array argument - I am able to send this now that I have specified:

$recipients = array('toAddress@mymail.com');
pet_send_mail('my_template_name', $recipients, NULL);