2

In my project we are sending promotion email to profile2 users after registration using Rules. Everything is working fine. We receive both email of registration link and promotion email. But Drupal give me following message:

Unable to send e-mail. Contact the site administrator if the problem persists.

I successfully receive both of email so there is no need of this error. I don't know why this is happens. please help me

I have set up my Rule using this article.

  • 1
    Are you using SMTP to send the emails? Check out the logs and update your answer with results from there, that will help others point you in the right direction. – Aram Boyajyan Mar 26 '15 at 11:29
  • Where i can find the logs – Swapnil0226 Mar 26 '15 at 11:38
  • Go to Reports->Recent log message – bisw Mar 26 '15 at 13:02
1

That error is shown when operating system reports an error sending an email.

If you check includes/mail.inc you can see:

if (empty($message['send'])) {
   $message['result'] = NULL;
 }
 // Sending was originally requested and was not canceled.
 else {
   $message['result'] = $system->mail($message);
   // Log errors.
   if (!$message['result']) {
     watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR);
     drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error');
   }
 }

$system->mail usually maps to the DefaultMailSystem. This function just calls mail PHP function. This PHP function uses the system mail agent to deliver the mail, and returns what the mail agent has returned. That means that PHP is not in charge of sending the mail, just deliver it to the system mail agent.

So, if you receive the mails probably is a system issue: system reports an error to PHP but actually mail is sent. Check your PHP logs, mail agent logs (sendmail or postfix are very popular) to see possible warnings or errors.

1

First, add the SMTP module and enable it. After this, create an e-mail account for the site admin (one that doesn't get checked), and used this address in the setup for the SMTP module. Cleared the site caches, and retested. All is good now.

Also--make sure there are no spaces or returns in any field when setting stuff up, and you may want to check with your Web host on what mail port they use (usually 25 or 26).

The main cause of this issue is that some Web hosts require SMTP e-mails to be authenticated in order to cut down on spam.

check below link for more info

link1

link2

link3

0
Unable to send e-mail. Contact the site administrator if the problem persists.
Unable to send e-mail. Contact the site administrator if the problem persists.
  • Download mail system module from official drupal site and enable that. Go to Structure then Contact form.Make sure that you are using right e mail adresss.
  • Now go to Module SMTP server and press Config.
  • Make sure that you put right information and you can send message.
    1. Turn on Module
    2. SMTP server: mx.000webhost.com
    3. SMTP port: 25
    4. Use encrypted protocol: No
    5. SMTP AUTHENTICATION your email address: your password:
    6. Enable debugging: Yes
    7. Save and good luck!

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