Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有php邮件功能的后缀-获得504_Php_Email_Postfix Mta - Fatal编程技术网

带有php邮件功能的后缀-获得504

带有php邮件功能的后缀-获得504,php,email,postfix-mta,Php,Email,Postfix Mta,在Ubuntu nginx上运行,postfix mail_版本=3.3.2 我正在尝试通过php邮件功能发送电子邮件,如下所示: <?php $to = 'me@gmail.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: support@xxxx.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X

在Ubuntu nginx上运行,postfix mail_版本=3.3.2

我正在尝试通过php邮件功能发送电子邮件,如下所示:

<?php
$to      = 'me@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: support@xxxx.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

任何指导都会很有用。

您是否检查了/var/log/postfix.log中的日志?postfix日志怎么说?嗨Mamoun。后缀日志为空。但是,邮件日志没有提供任何有关这方面的信息。我可以从服务器发送电子邮件,但不能通过php发送。我通过在php.ini中添加以下行来删除504:sendmail_path=/etc/postfix。然而,邮件并没有到达目的地。我将检查如何使日志工作。检查日志配置:如果您仍然使用postfix,还有一件事通常是邮件日志在/var/logs/mail.log中,请尝试检查它。您是否在/var/log/postfix.log中检查日志?postfix日志怎么说?嗨Mamoun。后缀日志为空。但是,邮件日志没有提供任何有关这方面的信息。我可以从服务器发送电子邮件,但不能通过php发送。我通过在php.ini中添加以下行来删除504:sendmail_path=/etc/postfix。然而,邮件并没有到达目的地。我将检查如何使日志工作。检查日志配置:如果您仍然使用postfix,还有一件事通常是邮件日志在/var/logs/mail.log中,请尝试检查一下。
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

readme_directory = no
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_un$
myhostname = name_of_my_host.linode.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = , $myhostname, Ubuntu-xxxx, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
maillog_file = /var/log/postfix.log