简体   繁体   English

Drupal 7不发送电子邮件

[英]Drupal 7 is not sending emails

I've a website created with drupal 7 with a customized theme, all seems to be fine except the contact form is not working. 我有一个用drupal 7创建的网站,有一个自定义的主题,除了联系表格不起作用外似乎都很好。

I have tested the server installation using a very basic PHP script to send emails, and the server seems to be well configured, but still Drupal does not send the emails. 我已经使用非常基本的PHP脚本测试了服务器安装来发送电子邮件,并且服务器似乎配置得很好,但Drupal仍然没有发送电子邮件。

As I'm less than a newbie in drupal, can any one tell me what I need to check to know where the problem is coming from, that I can hopefully fix it ? 由于我不是一个drupal的新手,任何人都可以告诉我需要检查什么,以了解问题的来源,我希望能解决它?

Further informations: 进一步的信息:

  • I have confirmed that the contact module is activated 我已确认触点模块已激活
  • I check the permissions, and every body is allowed to send emails 我检查权限,允许每个人发送电子邮件
  • I don't get any error after filling the contact form and sending it. 填写联系表格并发送后,我没有收到任何错误。

UPDATE UPDATE

This is the scritp I used to test if my server is configured to send emails: 这是我用来测试我的服务器是否配置为发送电子邮件的scritp:

<?php
    $to = "myemail@domaine.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    if (mail($to, $subject, $body)) {
            echo("<p>Message successfully sent!</p>");
    } else {
            echo("<p>Message delivery failed...</p>");
    }

As GeoPhonix suggested to me, I had a look on the log files on my server /var/log/mail.lo and I noticed that the email was sent but to a different email address which was set there by the website creator, and as I'm a less than newbie I could figure where the email address was set, following are the steps I solved my problem with: 正如GeoPhonix向我建议的那样,我查看了我的服务器/var/log/mail.lo上的日志文件,我注意到该电子邮件已发送,但发送到网站创建者设置的其他电子邮件地址,以及我不是新手,我可以想出电子邮件地址的设置位置,以下是我解决问题的步骤:


  1. using the command tail -f /var/log/mail.log I could watch the log changes 使用命令tail -f /var/log/mail.log我可以看到日志更改
  2. I sent an email using the drupal contant page 我使用drupal contant页面发送了一封电子邮件
  3. I noticed the log changed, and the email was successfully sent to a wrong email address. 我注意到日志已更改,并且电子邮件已成功发送到错误的电子邮件地址。
  4. I didn't know where to change the email so I search using phpmyadmin the whole database to fin the email in the webform table 我不知道在哪里更改电子邮件,所以我使用phpmyadmin搜索整个数据库来查找webform表中的电子邮件
  5. I search every part in drupal administrative interface where the word webform was mentioned to find where to change the email config 我搜索drupal管理界面中提到webform一词的每个部分,以找到更改电子邮件配置的位置
  6. after some time I find it in: content -> contact page -> webform -> emails and there was the email specified differently from the default contact email. 一段时间后,我发现它:内容 - >联系页面 - >网络表格 - >电子邮件,并且指定的电子邮件与默认联系电子邮件不同。

I just wanted to write what I did, may be someone will have the same issue or a similar one, that he can have a idea how to debug things 我只是想写下我所做的事情,也许有人会有同样的问题或类似的问题,他可以知道如何调试东西

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM