50 replies [Last post]
agerson's picture
Offline
Joined: 05/07/2009
Juice: 3
Was this information Helpful?

After completing the checkout process without error I get to cart/checkout/complete and get the error "Unable to send e-mail. Please contact the site administrator if the problem persists." However, the user account I am using as a test customer receives the "Your Order..." confirmation email. So what email is the error referring to? I would also add that the order confirmation email is delayed by a few minutes, while other drupal emails appear right away.

rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Which build are you using?

I had the same issue the first time I placed an order using 2.x rc2. I don't think it happened again after that as I believe I created another user and tested it again and it didn't happen.

What version are you using 2.x rc1, rc2, rc3?

I haven't tried the new rc3 yet but may have been fixed?

firfin's picture
Offline
Joined: 05/17/2009
Juice: 76
Same behaviour

I am experiencing the same confusing message, although the email gets sent.
There is also a message in reports/ recent log entries:
ca 05/18/2009 - 03:53 Attempt to e-mail invoice for order 5 to failed. Anonymous

In my case it isn't just the first time checkout is finished, but everytime. I am using Ubercart 6.x-2.0-rc3 . This is my first ubercart install so I do not know if it occurs in earlier versions.

Other mails (e.g. from E-cards) sent from the same Drupal install do not exhibit this behaviour.

--
Save a forest, kill a printer.

quikone's picture
Offline
Joined: 02/28/2009
Juice: 578
email

What email program are you using smtp or php? I had used the smtp version and had many problems. After switching to PHP mail I have had no problems.

firfin's picture
Offline
Joined: 05/17/2009
Juice: 76
which mail?

To be honest I dont know if I'm using php or smtp. I don't even what exactly you mean with that. Where is the setting for it so I can check it and report back?

But whichever I am using, it is working (without generating errors) for other drupal modules. It even works with the ubercart checkout page. It just generated an error, although the mail is sent.

--
Save a forest, kill a printer.

quikone's picture
Offline
Joined: 02/28/2009
Juice: 578
modules

Under admin/build/modules mail you should have the option of picking PHP Mailer or SMTP Authentication Support

firfin's picture
Offline
Joined: 05/17/2009
Juice: 76
No php maile ror smtp authentication

I dont't have the choice between php mailer of smtp authentication support.
I do however have mime mail enabled:
Mime Mail 6.x-1.x-dev
Mime Mail CSS Compressor 6.x-1.x-dev

Apparantly there are some issues using these two together (mimemail and ubercart checkout):
http://drupal.org/node/336408

I will try to fix this and report back (for future referents).
Thank you for helping me look in the right direction. Any further pointers /questiosn are of course welcomed.

--
Save a forest, kill a printer.

firfin's picture
Offline
Joined: 05/17/2009
Juice: 76
Solved

I found the answer and am almost to embarassed to report back Smiling

Looking around the apache error log I noticed:
sendmail: fatal: www-data(33): No recipient addresses found in message header

Which struck me ad strange as the mail to the customer is being sent. However the mail to the store administrator wasn't! And sure enough in the store settings I had neglected to set an emailaddress ( /admin/store/settings/store/edit/contact )

Hope this helps someone as dimwitted as me Smiling

--
Save a forest, kill a printer.

ryan_courtnage's picture
Offline
Joined: 04/20/2009
Juice: 24
thanks

you certainly helped this dimwit - I had the exact same problem!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: thanks

Just talking about this in IRC - seems silly that you can have that setting (in /admin/store/settings/store/edit/contact) empty at all. How comes this doesn't default to the site admin email? Or why doesn't Ubercart warn you about that like it does Images in the main store admin (/admin/store)? Seems it'd be an easy fix.

--
Help directly fund development: Donate via PayPal!

firfin's picture
Offline
Joined: 05/17/2009
Juice: 76
I wholy agree

I think the problem in my case was exactly that. I -incorrectly- assumed ubercart would just use the site admin email address. I'm glad it is possible to set a different emailaddress though.

Just goes to show assumption is indeed the mother of all f$#ck-ups Smiling

--
Save a forest, kill a printer.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15453
Re: Re: thanks

To be honest, given the code I'd expect it to work whether or not that e-mail was set:

<?php
// Returns the e-mail from string in the format of Store Name <store@email.com>.
function uc_store_email_from() {
 
$email_from = variable_get('uc_store_email', '');
  if (empty(
$email_from)) {
   
$email_from = variable_get('site_mail', ini_get('sendmail_from'));
  }

 

// Add the store name to the e-mail from line.  Must be optional to prevent
  // server conflicts.
 
if (variable_get('uc_store_email_include_name', TRUE)) {
   
$store = variable_get('uc_store_name', '');
    if (!empty(
$store)) {
     
$email_from = '"'. $store .'" <'. $email_from .'>';
    }
  }

  return

$email_from;
}
?>
ryan_courtnage's picture
Offline
Joined: 04/20/2009
Juice: 24
Re: Re: Re: thanks

I can duplicate the problem. It's just a UC install on which I never set up the Store Settings.
The following gets logged to watchdog by 'mail', note the message - the recipient address appears to be missing, not the sending address. The recipient in this case is the store owner, as the customer does indeed get the email.

Type mail
Date Friday, May 29, 2009 - 13:40
User admin
Location Referrer">http://blb/drupal/cart/checkout/complete
Referrer
Message">http://blb/drupal/cart/checkout/review
Message
Error sending e-mail (from ryan@xxxxx.org to ).
Severity error
Hostname ::1
Operations

I'm pretty sure the problem is in the "uc_checkout_admin_notification" predicate in uc_cart.ca.inc:

(line 102-109):

        '#settings' => array(
          'from' => uc_store_email_from(),
          'addresses' => variable_get('uc_store_email', ''),
          'subject' => t('New Order at [store-name]'),
          'template' => 'admin',
          'view' => 'admin-mail',
          'format' => 1,
        ),

'addresses' should probably be uc_store_email_from() rather than variable_get('uc_store_email'

Ryan

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: Re: Re: Re: thanks

Well I think you could still use variable_get, but instead of '' being the value to insert if that var doesn't exist, it should just use the default Drupal email address. (Either that or, again, a warning in the Store Admin dashboard to ask you to configure those settings seems fairly logical.)

--
Help directly fund development: Donate via PayPal!

Manop's picture
Offline
Joined: 01/11/2009
Juice: 18
Re: Re: Re: Re: Re: thanks

Just want to say thank you for this post. It takes me a while to fix this problem.

achilles085's picture
Offline
Joined: 07/29/2009
Juice: 9
This works for me!

wow! been wondering why did i got those errors then here you are guys! thanks this saves me alot of time!

paulg's picture
Offline
Joined: 02/26/2008
Juice: 23
Unable to send email

I just installed RC6 (from RC5), and in doing some testing I am getting 3 "Unable to send email" error messages when I do an anonymous checkout. No emails get sent (in contrast to what others have experienced in this forum.

The log is littered with mail errors such as the following:

Error sending e-mail (from "Developmental Science" <merchant@devscilabs.com> to testuser@eduviews.com).

Does anyone have any further ideas? I do have a Store email address set. To my knowledge, I haven't been getting any email errors up until I did the upgrade.

paulg's picture
Offline
Joined: 02/26/2008
Juice: 23
Re: Unable to send email

It turns out that my ISP must have recently broken PHP sendmail (as pointed out in another forum thread that escapes me at the moment). I can't send email from the Drupal contact form or any other Drupal module.

As a short term fix (I expect the ISP to fix the sendmail problem), I installed the SMTP module and now route mail using SMTP.

kepol's picture
Offline
Joined: 12/04/2009
Juice: 2
Possible workaround

After scouring the web, issue queues, and the code, I tried turning off the auto-login feature for anonymous users and *then* emails got sent. Prior to that, emails were only sent if the user was logged in. In looking at the code, I think I may know how to fix it though I'm not sure where I'm supposed to send a patch.

But, I still am getting the "unable to send" message since somewhere in the system it's trying to send an email to "" (blank) though, for the life of me, I can't figure out where this is happening. I'm using smtp and not sure if that is part of the puzzle or not.

Kristen

drjonez's picture
Offline
Joined: 03/12/2009
Juice: 35
Re: Possible workaround

I'm getting this message. error reporting says:

Error sending e-mail (from "client name" <customerservice@client.com> to <p>user@hotmail.com</p>).

This is right after a user creates an order.

For some reason the email address is being wrapped in tags. I'm not sure what's causing this. There's no rich text editor for entering an email address....

Digging deaper.

Edit: It was actually a â„¢ symbol in the Store Name that was throwing the erorr. I checked the box that removed "store name" from the mail and all was fine.

renb's picture
Offline
Joined: 05/01/2010
Juice: 6
email issues in Drupal

Not sure if this is helpful or not..

We have been testing Drupal deployments on a few different servers and have found something wrong with the mail() function in php 5.10 through 5.12
All drupal sites we installed had the same non functioning error. Server didn't matter. we tied FreeBSD and Linux. Although we did not try any win flavor..

started documenting it here: http://www.unixug.com/weBlog/content/problem-email

Ren

romerofred's picture
Offline
Joined: 12/19/2010
Juice: 5
Thanks for keeping it simple

I'd been racking my brain for days trying to workout why it wasn't doing this. I feel a little stupid now. PMSL.

daveydo's picture
Offline
Joined: 01/05/2009
Juice: 94
are you using a wysiwyg editor ?

I had this problem when the email addresses where being formatted by fckeditor to include tags around the email address.

firfin's picture
Offline
Joined: 05/17/2009
Juice: 76
Re: are you using a wysiwyg editor ?

I get it on the checkout completion page. Just like the first poster in this thread.
on /cart/checkout/complete

--
Save a forest, kill a printer.

markagray's picture
Offline
Joined: 09/09/2009
Juice: 192
Same erorr message / different conditions

I also get the "Unable to send email" message on the Order Complete page, however, in my case the message is intermittent and the user DOES NOT get the email. Instead an email about the error is sent to the site's admin email address which is the address assigned to the store. For the few orders that this error occurs on, when I open the order to look at the status, there is the "Customer info" block with a field labeled "Primary email" and the value of that field is blank. For the majority of orders where the "Unable to send email" message is not displayed, the "Primary email" field correctly holds the email address of the user that placed the order AND the email goes through to the user.

I'm using Drupal 6.16 and Uber 2.2

Has anyone had this error under these conditions?

seanh's picture
Offline
Joined: 10/26/2009
Juice: 9
Re: Same erorr message / different conditions

I'm seeing similar things on our site right now.

Right now we have anon check-out turned off, so my current line of investigation follows the path of seeing where the email gets picked up. Thinking that maybe it's grabbing the email address of the anon user (blank) before they login or something like that.

tjackson's picture
Offline
Joined: 04/20/2010
Juice: 11
Same issue here..

We're having the same issue on our end. I have a dev environment set up, and everything works there. On live, with the same settings, I get the error. I've got store information all set with a valid email, though it's an alias, and that should work as it does on my dev site.

Users all get their mail, and the admin gets one, but we also get a failed to send error in the log, with a blank "to" address..

Just curious if there's been any progress as the aforementioned tips didn't work out so well for me.

michael's picture
Offline
Joined: 05/01/2010
Juice: 10
Call to drupal_mail is not defensive enough

I had the same issue. I tracked it down to the CA code of affected modules, for example uc_order and uc_roles.

The problem lies in these lines of code, which is present in quite a few core ubercart modules.

<?php
foreach (explode("\n", $addresses) as $address) {
 
$recipients[] = trim($address);
}
?>

The explode() manages to create an empty element in the resulting array, so $recipients get filled with valid e-mails PLUS an empty string at the end.
I tried looking for a trailing comma or new line character in all the textarea/textfields in the admin pages I could think of that would affect this, but I couldn't find any.

So my solution was to be defensive in the call to drupal_mail() later on, checking for empty($email) before calling drupal_mail() on line 1161 in uc_order.ca.inc and all other modules which use the above lines.

I attached a patch of uc_order.ca.inc which removed the warnings for me.

I don't know if this is a PHP setting issue or not, or if this even is the correct place to fix it. The $addresses variable should maybe be trim()'ed or validated before getting here, I don't know...
But at least this is a work-around for those less skilled with programming and debugging.

Hope it helps someone.

EDIT: Forgot to mention I created the patch against Ubercart-6.x-2.2

AttachmentSize
uc_order.ca_.inc_.patch 1.93 KB
trinin's picture
Offline
Joined: 07/13/2010
Juice: 12
does this fix the problem?

If this is a fix, then what am I supposed to do with the attached patch you have there? Kind of a noobie...

michael's picture
Offline
Joined: 05/01/2010
Juice: 10
Re: does this fix the problem?

You have to apply the patch against the file "uc_order.ca.inc". You can find that file in /sites/all/modules/ubercart/uc_order/uc_order.ca.inc
See http://drupal.org/patch/apply for detailed information on how to apply a patch.

Good luck.

superjuggler's picture
Offline
Joined: 09/15/2010
Juice: 3
Re: Call to drupal_mail is not defensive enough

Same problem on Ubercart-6.x-2.4. I've just applied your patch (manually). I thought I could play with ckeditor to clean up the addresses, but haven't found the culprit there yet.

Thanks, your patch did help me!

jestith's picture
Offline
Joined: 02/04/2011
Juice: 4
Thansk. Patch cured 6.x-2.4

Thank you very much for the patch. Would be very cool if the Ubercart people incorporate it.

I just started seeing the email sending problem when a new user completed checkout.

The problem surfaced for me just after turning off "Require e-mail verification when a visitor creates an account" because a user who had an invalid credit card number failed to have his new account properly created on checkout.

Thanks again for providing this extremely helpful patch to Ubercart.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: Thansk. Patch cured 6.x-2.4

Is this patch in the issue queue on Drupal.org? It should go there, so longwave or someone can apply it to the dev version of UC. http://drupal.org/project/issues/ubercart

--
Help directly fund development: Donate via PayPal!

ilyarogov's picture
Offline
Joined: 01/20/2011
Juice: 3
Re: Call to drupal_mail is not defensive enough

Thank you so much. I began having this problem last week and your patch fixed it up nicely. Well done!

dragonhorn's picture
Offline
Joined: 05/12/2010
Juice: 8
Re: Unable to send e-mail.

I had the same problem as first described. Checked out daveydo's solution as I use ckeditor. Sure enough ckeditor was being used under conditional actions. It was adding extra formatting to recipient email addresses under Actions for predicates with a notification class.

Fixed the problem by going to ckeditor global profile (admin/settings/ckeditor/editg) and under Visibility settings I added admin/store/ca/* to the list of Fields to exclude.

I have since tried a couple of dummy orders under the same user as I was getting the errors before. All good!! Smiling No more errors.

I hope this helps.

Cheers

Bill

NB: After making the above change I had to go into each notification predicate and get rid of the extra formatting around the recipient email address under Actions and then Save changes.

lameei's picture
Offline
Joined: 01/24/2009
Juice: 23
Re: Re: Unable to send e-mail.

I just solved this issue and also this one by :
1. disabling CKEditor.
2. resetting all the predicates which have the reset link available at admin/store/ca.

Now everything is working properly.

bleeuwen's picture
Offline
Joined: 11/09/2010
Juice: 14
Great answer

Hi

your answer solved my problem

Timerider's picture
Offline
Joined: 12/09/2011
Juice: 7
Worked for me, too!
dragonhorn wrote:

Fixed the problem by going to ckeditor global profile (admin/settings/ckeditor/editg) and under Visibility settings I added admin/store/ca/* to the list of Fields to exclude.
NB: After making the above change I had to go into each notification predicate and get rid of the extra formatting around the recipient email address under Actions and then Save changes.

After being up until 4am yesterday and the prospect of the same today trying to work out what had led to this problem your solution worked for me, too!

Many thanks Bill, due to your solution our shop can now participate in the xmas "rush"!!

Barry
Übercart at: www.montessori-material.cz/a/

Dubber Dan's picture
Offline
Joined: 10/23/2010
Juice: 74
Re: Re: Unable to send e-mail.

thank you thank you thank you

I'd been tearing my hear out!

jumpfightgo's picture
Offline
Joined: 12/03/2009
Juice: 24
check your conditional actions

I also experienced this problem in ubercart.

In my case, it turned out that i had an extra blank line in the e-mail recipients field of a conditional action.

That certainly seems like a bug to me, should be smarter than that.

eurotransient's picture
Offline
Joined: 02/18/2011
Juice: 19
jumpfightgo wrote: I also
jumpfightgo wrote:

I also experienced this problem in ubercart.

In my case, it turned out that i had an extra blank line in the e-mail recipients field of a conditional action.

That certainly seems like a bug to me, should be smarter than that.

Thank you so much! That red "Unable to send e-mail" bar was starting to get on my last nerve.

trinin's picture
Offline
Joined: 07/13/2010
Juice: 12
help?

I desperately need to find a fix for this error "Unable to send e-mail"

it send an order fine to me admin, however the customers are not getting their invoices and this is becoming a huge problem! I have scoured this forum for a real solution and have not been able to find anything that works. I have a tried everything. My settings and triggers are setup correctly, and nothing seems to be working!

trinin's picture
Offline
Joined: 07/13/2010
Juice: 12
thanks!

I got it working thanks!

petiar's picture
Offline
Joined: 11/25/2010
Juice: 9
Re: thanks!

What have you done? I have got the same problem - e-mail to e.shop owner is being sent correctly, however, customers are not getting their order confirmation e-mails... I am not using any wysiwyg editor.

ovkon's picture
Offline
Joined: 03/10/2011
Juice: 3
Re: thanks!

Hi there, ye, please let us know hwat have you done to make it workin?
its drivin me crazy!

markagray's picture
Offline
Joined: 09/09/2009
Juice: 192
Is everyone using the Autologout module?

I am wondering if everyone having this problem is a user of the Automated Logout (autologout) module?

michael's picture
Offline
Joined: 05/01/2010
Juice: 10
Not using Automated Logout

No, I do not use Automated Logout (autologout) module and still have the problem. So it is not related. Look at my previous comment above for a suggested fix/patch.

domhay's picture
Offline
Joined: 02/03/2011
Juice: 11
Re: Unable to send e-mail.

I'd been having this problem also.

The store name had a period at the end of it "ABC Dist.", I removed the period and emails are now being sent as usual. Hope that helps someone.

domhay's picture
Offline
Joined: 02/03/2011
Juice: 11
Re: Unable to send e-mail.

I'd been having this problem also.

The store name had a period at the end of it "ABC Dist.", I removed the period and emails are now being sent as usual. Hope that helps someone.

sukr_s's picture
Offline
Joined: 06/30/2011
Juice: 8
Re: Re: Unable to send e-mail.

i posted a solution for this issue at http://drupal.org/node/455888#comment-4674252 check if this solves your problem as well.

------------------------------------------------------------
http://www.drupalfx.com

DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1738
Another possibility: selinux

For people hitting this via Google, there is another, completely different possible cause for this problem: The selinux default configuration prevents apache from sending e-mail via sendmail. Selinux is enabled by default on Fedora.

This is apparent from the following log message in /var/log/maillog: sendmail[2640]: NOQUEUE: SYSERR(apache): /etc/mail/sendmail.cf: line 0: cannot open: Permission denied

The solution is dead easy. Just enter the following command: setsebool -P httpd_can_sendmail 1