I will keep this short since I will not be able to edit this issue post once I create it... I'll put more in the comments.

I tried using the MimeMail HTML email action while having MimeMail use SMTP as its mail service and I got this error:

"The submitted from address () is not valid."

I debugged it and have a patch. See more in the comments.

CommentFileSizeAuthor
#1 smtp.module.patch1.12 KBkristen pol

Comments

kristen pol’s picture

StatusFileSize
new1.12 KB

Here's the setup:

1) install smtp & mimemail

2) configure smtp with smtp server, from, etc.

3) configure mimemail to use smtp server

4) create a new rule that uses the mimemail html email action (for example, if content is changed, send an html email... put some html in the email text)

5) do whatever you need to do to trigger the rule in #4 (e.g. edit/save content)

You will see the error: The submitted from address () is not valid

I went in and debugged it and found some missing parentheses in the smtp module.

    if ($from = variable_get('smtp_from', '') == '') {
      // If smtp_from config option is blank, use site_email.
      if ($from = variable_get('site_email', '') == '') {

needs to change to:

    // If from e-mail address is blank, use smtp_from config option.
    if (($from = variable_get('smtp_from', '')) == '') {
      // If smtp_from config option is blank, use site_email.
      if (($from = variable_get('site_email', '')) == '') {

I have attached a patch.

Note that this is a general bug and may come up in other configurations as well but I just saw the issue with this particular configuration.

DarthDrupal’s picture

Same issue here. The patch worked. thanks!

cjback’s picture

Same issue. The patch worked for me as well. Thanks Kristen!

saurabhk_97’s picture

I had the exact same issue and the patch worked perfectly. Thank you very much Kristen.

Regards,

Saurabh Kumar

josesanmartin’s picture

Assigned: Unassigned » josesanmartin
Status: Needs review » Closed (duplicate)

An identical patch has been commited to HEAD at http://drupal.org/node/1012062