I'm using the contact form, smtp module and secureserver as the mail server. When I run tests via the smtp settings page. Everything works as it should. When I use the contact form, SOMETIMES I get an error other times I don't. After reviewing the drupal log as to what the issue might be. I get the 2 following error for the ones that don't mail out. I get this smtp error;

Error sending e-mail from *@something.com to *@something.com : The following From address failed: *@something.com

SMTP server error: Sorry, your envelope sender is in my badmailfrom list.

and another error which simply states it couldn't send the email. After running some tests and reviewing the mail headers of the emails that did go through. It seems as thou it sends FROM the email address the user is inputting. This to me like the server would deny it because this essentially is a 'spoof'. On the site information email, we are using "[email protected]". On the smtp settings, we are using a "[email protected]". I tried a test by changing the dnr email to the info and it still has the intermittent fails.

Update: I've narrowed down the problem to a Godaddy issue. We don't use the 'web' hosting server as our email server. We use their "Email" server which is the "secureserver" most people have problems with in the threads I've read. We ended up switching over to gmail and everything works as it.

@Citricguy: Naw, we aren't blacklisted. It's just that they have several configuration issues with those email servers. To the point that their own techs don't know what they are talking about half the time..

  • There may be a Drupal specific response to this, but need more details. Are you on a shared host? Are you using your hosts SMTP service? Do you have complete control over your DNS records?
    – Citricguy
    Jul 26, 2012 at 2:59

1 Answer 1


You may have been blacklisted by the server you're try to send mail to. Check this first.

To help from being marked as spam send from an address ending with your domain name.

For example: [email protected] or [email protected]

Then you can set the "Reply-To" header email address to your users email using hook_mail().

Something like this maybe?

$params['reply-to'] = $user->mail;

function HOOK_mail($key, &$message, $params) {
    switch ($key) {
        case 'your-key-here':
            $message['Reply-To'] = $params['reply-to'];
            $message['subject'] = $params['subject'];
            $message['body'] = $params['body'];
            $message['headers']['Reply-To'] = $params['reply-to'];
            $message['headers']['Return-Path'] = $params['return-path'];

It has been forever and a day sense I've looked at this last, but you may want to scope out RFC822.

Note that ['Return-Path'] is important here as well if you monitor emails for bounces (hard/soft/etc). Where ['Reply-To'] directs replies, I believe ['Return-Path'] directs bounces and errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.