Hi

My drupal driven site won't send e-mails.

I know smtp on my server is working.

Users get confirmation that mail has been sent.

No emails are received.

Site is based on Drupal 6.

What can I do? I have an Elgg installation on the same url which e-mails fine.

Comments

vm’s picture

Drupal uses php mail by default.

insure you have a correct address set up in administer -> site information

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

mbull’s picture

I know the address is fine. I've tried a few.

I've been trying to cure this for 2 weeks now and it's preventing me from going live.

vm’s picture

don't know what to tell you. you don't offer much information for diagnosis.

What I can tell you is my sites using 5.7 and 6.1 are both sending email perfectly well.

note: that duplicate threads about the same issue that had no comments I"ve deleted. There is no need to crosspost multiple threads about the same issue. If you must, re comment on the thread and push it back to the top of the forums.

For others reading: see http://drupal.org/node/234440 which is another post with some commenting

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

mbull’s picture

What other info can I provide?

Did you have to make any changes other than entering your 'from' email address in the administation area?

Which file provides the smtp info? Would you know?

My host uses php5 and says I need to add an extra parameter, but I don't know where.

vm’s picture

Drupal does not use SMTP by default that would be controled by the SMTP module that isn't updated to Drupal 6 yet.

with regards to the extra parameter, it would help if your host was more forthcoming with information about what parameter they are talking about. All my sites run on PHP5 and I didn't have to add any "extra parameter" to anything.

I set an email address and mail gets sent.

Is the email address in use, using the same domain that the drupal site is installed on ?

does contact form email get sent ?
does request new password emails get sent ?

have you tried as an authenticated user ?

do the users stating they don't get email all on the same domains ?
is it possible that the emails are indeed being sent, since drupal is saying they are and those emails are being caught in the spam catchers or the users who state they aren't getting them ?

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

mbull’s picture

This is what they sent as an example.

The issus you are having are occuring because there is a missing fifth parameter in your mail script. This has always been a requirement of mail scripts on our shared hosting platform but recent updates to our Linux servers (from PHP4 to PHP5) has meant that this is now always required.

An example of how to use this is displayed below:

mail($to, $sub, $mess, "From: root@willow-designs.co.uk", "-froot@education-community.co.uk")

If there is no module for smtp at drupal 6, could it be a server issue then?

mbull’s picture

Sorry. Now I'm getting confused.

That was a reply to an Elgg querie, which is preventing e-mails with .ac.uk suffixes being sent.

Please ignore the content of my last post.

mbull’s picture

Okay.

I set an email address and mail gets sent.

All e-mail addresses are in use. I'm using all sorts of different 'test' mails.

does contact form email get sent ? - No
does request new password emails get sent ? - No

have you tried as an authenticated user ? - Yes

do the users stating they don't get email all on the same domains ? - No
is it possible that the emails are indeed being sent, since drupal is saying they are and those emails are being caught in the spam catchers or the users who state they aren't getting them ? - No

vm’s picture

not much else I can comment on at this stage. Maybe set up a gmail account (if you don't have one already) and try using the gmail address to see if that will work ?

last resort, build on Drupal 5.7 where there is an SMTP module available for use and only update to Drupal 6 when all modules you use are updated to Drupal 6.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

rbiffl’s picture

mbull, I'm having exactly the same problem on my Drupal 6.1 installation. I wish I could help you. For now, we're just having to make do without a working Contact form.

mbull’s picture

I'm working with the patches at the moment and hope to get things working soon. I'll post here if I make any progress.

damiancugley’s picture

There are two things referred to as a ‘from address’ in an email message: the From header (which is set using the Adminster -> Site Information page) and the envelope address, also called the sender or the return-path.

To set the envelope address on Unix, you invoke the sendmail program with an option -fuser@example.com.

To call the sendmail program on PHP you call the mail function. To set the -f option, you use the FIFTH PARAMETER your ISP has mentioned.

To call the PHP mail function in Drupal, you call drupal_mail. This sets the from member of its message array correctly and then calls drupal_send_mail<code>, which ignores the <code>from member and DOES NOT SET THE FIFITH PARAMETER. So sendmail gets no -f option. So some recipients’ mail systems will reject your message because the sender address is wrong.

To override this you have a few options.

First, you can edit the Drupal source code directly. This is problematic because your changes will be clobbered next time you upgrade the software.

Second—and here I am guessing from reading the source code because I cannot find documentation for Drupal 6.x—you can override the mail function by writing a function called drupal_mail_wrapper, placing it in a file called something like fifth_parameter_to_mail.inc and editing settings.php to set the system variable smtp_library to the name of your file. This seems like a lot of effort when they could have written drupal_send_mail to do it in the first place.