By arethusa on
Hi, I have Drupal set up on a Mac, running on a PHP server. While creating a new user and checking the send e-mail notification option, I get a message saying that e-mail has been sent to the new user, but the e-mails are not getting received. I tried different e-mail domains like gmail, yahoo and the same domain that I am using, and still the e-mails are not getting sent. Can somebody please help me out on this? I am spending a lot of time trying to figure this out. Thanks in advance.
Comments
E-mail not being sent
Hi, Can anyone please help me out in this? This is really important for my project.
Thanks.
Bump! Someone has faced this
Bump!
Someone has faced this before? Please do help me out!
have the same problem
i have the same exact problem..
i take it.. drupal doesnt have a decent email sending feature period.. because im not the only that's run into it..
ive tried downloading and installing the smtp module but it all routes down to the same issue.. cannot send verification email..
can anyone here please help us out.. ive been to your sites and i can see it works for you all..
Drupal does not include an
Drupal does not include an email server-- that's not really a CMS function but rather a system function. Linux has it as part of the distribution by default, windows doesn't and therefore requires adding a mail server. AFAIK, MAC OS X comes with sendmail-- perhaps it needs some configuring (http://drupal.org/node/100875 seems to indicate this, found by typing "mamp email" into the d.o searchbox).
The http://drupal.org/project/smtp module is one option if you want to use an external server like gmail. But if you don't configure it properly (i.e. not to look for an internal server on localhost) it won't work either unless you have a local mailserver installed and configured properly.
Additionally, there's the complication of the fact the ISPs will often block port 25 so you can't sent these types of email from a local dev box (as a protection against spammers using their infrastructure).
hope that helps some...
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Hey WordFallz, thanks for
Hey WordFallz, thanks for your reply. The PHP server i am running drupal on has SMTP configured and e-mails are sent successfully from there. So it is something to do with drupal email settings I guess. I have set a "from" e-mail id in site information which is user@domain.com which is the domain that emails are sent from.
Anything that I need to check in the drupal settings to solve this problem? I am really in a fix and need to get the e-mail running fast. Please help me.
afaik there really aren't
afaik there really aren't any drupal settings for email-- it's all handled via php which is working for you. I've never had a problem with drupal sending email if the underlying email server & php were functioning properly.
You don't have a wysiwyg editor on the email form fields by any chance do you? If so, turn it off and try again.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
No, I don't have a wysiwyg
No, I don't have a wysiwyg editor on the registration page. Anything else you would advise me to try?
My PHP server has these
My PHP server has these settings for e-mail:
sendmail_from no value
sendmail_path /usr/sbin/sendmail -t -i
serialize_precision 100
short_open_tag Off
SMTP localhost
smtp_port 25
Should the sendmail_from value be set too? Even if the server is running on a UNIX machine?
i'm afraid you're out of my
i'm afraid you're out of my area of expertise-- my localhost is a windows box and my *nix hosted sites are managed so I didnt have to do any of the system config.
It's probably worth a try though (i doubt it could hurt)-- but you said that you tested the email via php and it worked so I'm not sure how the php settings could be the problem.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
I am having a similar
I am having a similar problem on my dev server (Mac OSX). I know php mail() works because other scripts on this machine can send e-mail fine. (e.g. zen cart).
I have two drupal installations on this machine, and neither will send any e-mail. They don't give any error messages, either - when I look at the log, it says the e-mail has been sent. I have tried a number of different types (e.g. contact, password reminder, ecard module, etc.) and none of them work. The one I am currently working on has been upgraded to drupal 6.6 - I think the older one may be 6.4
I will definitely need to get this fixed before I can finish development and deploy.
thanks
http://maia-arts.com/music
http://inthedeepmuseum.com
I am having the same
I am having the same problem, but I do recieve a very speceific error.
no one is able to register, and this is the last major hurdle I have, but it will invalidate all of my hard work if this cannot be fixed.
maybe browsing through some
maybe browsing through some of these might help.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
the error tells you what to look for
somewhere in either the subject, body, from address, somewhere, you are putting unknown or invalid characters into the mail function.
Have you customized the welcome email subject?
Have you customized the welcome email body?
Did you paste information into these fields from another app, like MS Word?
On of these items has invalid characters that are killing the php mail function.
what if there's no error?
That's great for the folks who are getting error messages. I am not getting any errors but no e-mail is being sent. Not even for new registrations or password reminders - I don't think that's a problem with malformed e-mails or bad characters. It must be something to do with drupal since my other scripts can send e-mail. Any suggestions of what I should look for?
Update: I just installed a fresh copy of drupal 5.12 as well (so I can test a couple of modules that are only available for 5.x). I have not yet installed any modules or made any configuration changes. It does not send e-mails either - no confirmation for my account, no password reminder email.
I noticed that the original poster also was running drupal on Mac OSX. Maybe there's something about drupal's mail() call that doesn't work with the php running on the Mac?
thanks
http://maia-arts.com/music
http://inthedeepmuseum.com
Try a little debugging?
If you're up to it you can try a little debugging:
Edit /includes/mail.inc and add code around line 184 so it looks like this:
Next trigger sending an email somehow (contact form) and then check the logging.
Post back with the values (anonymized where applicable of course)
- Arie
thanks for the tip
Thanks, I tried that, also very helpful to see how to add custom debug points since it will help with my module development.
The results don't seem that informative to me. This all seems pretty standard - nothing jumps out as an obvious error.
mimeheaders = Array ( [0] => MIME-Version: 1.0 [1] => Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes [2] => Content-Transfer-Encoding: 8Bit [3] => X-Mailer: Drupal [4] => Errors-To: myemail@myhost.com [5] => Return-Path: myemail@myhost.com [6] => Sender: myemail@myhost.com [7] => Reply-To: myemail@myhost.com [8] => From: myemail@myhost.com )
message = Array ( [id] => contact_page_mail [to] => myemail@myhost.com [from] => myemail@myhost.com [language] => stdClass Object ( [language] => en [name] => English [native] => English [direction] => 0 [enabled] => 1 [plurals] => 0 [formula] => [domain] => [prefix] => [weight] => 0 [javascript] => ) [params] => Array ( [name] => myusername [mail] => myemail@myhost.com [subject] => test [cid] => 1 [message] => test [copy] => 0 [op] => Send e-mail [submit] => Send e-mail [form_build_id] => form-d50bf9f03f54fa34acbcb79dab76119e [form_token] => 0272f4cc130b28b3d88effc378a4fef8 [form_id] => contact_mail_page [contact] => Array ( [cid] => 1 [category] => general inquiries [recipients] => myemail@myhost.com [reply] => [weight] => 9 [selected] => 1 ) ) [subject] => [general inquiries] test [body] => myusername sent a message using the contact form at http://localhost/testsite/?q=contact. test [headers] => Array ( [MIME-Version] => 1.0 [Content-Type] => text/plain; charset=UTF-8; format=flowed; delsp=yes [Content-Transfer-Encoding] => 8Bit [X-Mailer] => Drupal [Errors-To] => myemail@myhost.com [Return-Path] => myemail@myhost.com [Sender] => myemail@myhost.com [Reply-To] => myemail@myhost.com [From] => myemail@myhost.com ) )
http://maia-arts.com/music
http://inthedeepmuseum.com
Seems ok
It could be that the mail server just doesn't allow sending email with these settings. Are you running Drupal locally? Do you see any errors in sendmail's log (/var/log/mail.log) ?
- Arie
P.S.
For readability I should have posted
I think that's it
Yes, I looked in the mail logs and it turns out it is a problem others have discussed here related to Mac e-mail: the mac is using a MacUserName@MacLocalComputerName.local as the sender... I will try editing the postfix main.cf and see if that works
http://drupal.org/node/100875
I'm just puzzled why this is drupal-specific - I have had no problems with other scripts (custom scripts, zen cart, gallery2, oscommerce) sending e-mail on my mac. If I can figure that out I will post it back.
thanks again for your help!
http://maia-arts.com/music
http://inthedeepmuseum.com
specific to drupal
My guess is because Drupal sets quite a few additional headers, whereas a lot of php software just sets a 'From' and 'reply-to' address. Those extra headers might cause the Mac mail to choke for some reason, it would be an interesting excercise to add those headers in a standalone test script and run it, see if the mail works, if I had a mac here I would try it
Another test would be to empty the mimeheaders array and drupal and test it, see if it works in drupal.
Got it working with Bitnami MAMP install and this blog post
I installed Drupal 6.4 on top of the Bitnami.org MAMP stack. I noticed that emails were not being sent when I tried to create a new user on my localhost Leopard machine. All I had to do was follow the steps at this blog post: http://blog.johnbain.org/2008/07/08/configuring-a-smtp-mail-server-on-ma.... In fact, within seconds of finishing step 7 I received an email notification for a new user that I tried to set up yesterday! The email had just been sitting there in the queue waiting for the mail server to start and send it out.
Note that I did not even have the MAILSERVER line on my /etc/hostconfig file, which I think is typical for a new Leopard install.
The email address I registered the new user with uses my company's domain name hosted at CrystalTech (not sure if this is important, but maybe they are among those who don't block the port 25 relays).
I hope this helps someone.
This link is probably more complex than needed...
You don't actually need to have the Postfix server running on your Mac all the time, which is what this link describes how to do. The Mac is set up to start and stop postfix automatically whenever there is mail to send. See the link which I posted below: "Using gmail for outbound smtp on Mac OS X Leopard" (http://www.installationexperiences.com/?p=87)
Setting up Leopard to use Gmail to relay outbound mail
Here's a page: "Using gmail for outbound smtp on Mac OS X Leopard"
http://www.installationexperiences.com/?p=87
Read the first four comments as well.
I followed these instructions, after which sending mail from PHP on my Mac seemed to work fine.
Note that you have to store your gmail password in a file on your Mac. You should secure that file (see the comments on the post), but I also have a special gmail account just for sending out these emails, because it is a bad mistake to compromise the password to your main gmail account.
mac problem
We're using a mac os x server, too, and also occasionally see problems with emails.
Bottom line, don't use mac os x as a server.
For example the mac version of php doesn't include the gd module. Their LDAP server doesn't work with the php ldap module (and thus not with the drupal ldap module either). There are other reasons, too, including: http://www.linux.com/feature/139452
You can run a Linux distro on a mac, such as Ubuntu or Debian.