I have a script that executes based on a condition set by the workflow-ng module, and it basically just creates an email.

I'm using the mail function, like so: mail($to, $subject, $body)

SMTP module is enabled and working, it works for the rest of the site. But when it executes this custom PHP snippet, it still uses the mail function and sends from "nobody". How can I use SMTP module in my custom php snippet?

Comments

graper’s picture

that is the improper mail function to use as you are using the php mail function. You need to use the drupal_mail() function
you can find more information on the drupal mail function here. http://api.drupal.org/api/function/drupal_mail/5

sansui’s picture

Status: Active » Fixed

Thanks, using drupal_mail worked perfectly. Problem solved

sansui’s picture

Status: Fixed » Closed (fixed)