I have tried to send email using form on page /example/email_example but it doesn't work. It shows message that "Email was successfully sent" but it didn't arrived.
I don't think it is bug, probably somethig wrong is set on server site. Other emails from the website are sent ok (confirmation of user registration, Ubercart order confirmation are sent all right)
so sender email address should be OK.

When I look into $params variable in email_example_mail function, it has these array keys:
email, message, submit, form_build_id, form_token, form_id, op

Should there be also 'from' key? (I see it in uc_order _mail in uc_order.module in Ubercart which send mails correctly)

When I tried to send mails from another server and another Drupal instantion, Email example works OK. So problem is probably on my server.

What should be checked on server for searching for problem?

thanks for any advice
Tomas

Comments

rfay’s picture

Have you tried sending email other ways from your site? Like using a contact form? I regularly get (bounces of) emails sent from http://d7.drupalexamples.info...

tomas.teicher’s picture

Yes, comfirmation emails after user registration are sent as well as Ubercart mails after submitting orders.
I tested the same receiver email address.

I tested sending mail from your mentioned URL and it works, mails arrived. But from my website it doesn't work.
The problem is probably on server, but I don't understand why other mails are outgoing and mails from /example/email_example form not. Couldn't be clue to problem $params variable as I mentioned in issue description?

thanks for any advice
Toams

rfay’s picture

Just FYI... Gmail and many other services do strange things with mail that is sent *from* you, if that's the case here. Gmail sticks it in the Sent folder but not the Inbox. Yahoo puts it in the spam folder if it didn't originate on Yahoo.

rfay’s picture

I strongly recommend using a module like reroute_email when doing debugging like this. It sorts out the issues from #3

tomas.teicher’s picture

thanks

I have problem with each email address I test not only gmail and yahoo. Ubercart mails and user registration notifications are sent to users correctly. I don't know why just this form doesn't work.
Anyway, I need to send mails to gmail and yahoo.

I have installed this module on the another server on another Drupal website and there this form works. So there is something definitely worng set on server.

I have installed Reroute mail module, but no meial address works so I cannot test with testing email address.

What should I check on server confifguration or .htaccess,
can anybody help?

rfay’s picture

Status: Active » Closed (works as designed)

If you look at the server's maillog, you'll see what happens to these. On Debian/Ubuntu this would be /var/log/mail.log.

A common reason that outgoing mail won't work is that the from: address is invalid.

Another common reason would be that the host in question has a reputation as a spammer. However, this won't cause gmail not to deliver it; it just causes it to go into the spam folder. You can look up your host's reputation at places like http://www.mxtoolbox.com/blacklists.aspx - however, it's unlikely that's the issue since other techniques send email.

I should note though, that the email example is designed to teach you how to send email with code. It's not for deployment on any server.

Followup on this should probably go to a place like http://drupal.stackexchange.com. Marking as closed here. But please do follow up with a link to your results (and your question where you seek server support).