【问题标题】:Try to send mail with PHP but not delivered [duplicate]尝试使用 PHP 发送邮件但未送达 [重复]
【发布时间】:2017-08-07 14:51:27
【问题描述】:

我尝试用我的地址邮件从 PHP 发送一封电子邮件,但邮件没有送达。这是日志:

Mar 15 23:11:30 vps-**** sendmail[5519]: v2FMBUKG005519: Authentication-Warning: vps-21663.fhnet.fr: www-data set sender to mywebsite@site.com using -f

Mar 15 23:11:30 vps-**** sendmail[5519]: v2FMBUKG005519: from=mywebsite@site.com, size=633, class=0, nrcpts=1, msgid=<58c9bc127f710@site.com>, relay=www-data@localhost

Mar 15 23:11:30 vps-**** sm-mta[5520]: v2FMBU6A005520: from=<mywebsite@site.com>, size=830, class=0, nrcpts=1, msgid=<58c9bc127f710@site.com>, proto=ESMTP, daemon=MTA-v4, relay=vps-****.****.fr [127.0.0.1]

Mar 15 23:11:30 vps-**** sendmail[5519]: v2FMBUKG005519: to=myemail@outlook.com, ctladdr=mywebsite@site.com (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30633, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v2FMBU6A005520 Message accepted for delivery)

我是新手,我有几个关于邮件的问题。 我有一个地址邮件:no-reply@site.com。

我需要使用哪个服务器 smtp?

我们在哪里配置要使用的邮件、密码、端口...?

因为我已经在php中配置了,但是我需要修改我的conf php,或者sendmail的conf?

感谢您的帮助!

【问题讨论】:

  • 它说它被接受了,这意味着它可能被另一边的垃圾邮件过滤器捕获了。

标签: php email configuration debian sendmail


【解决方案1】:

PHP 有一个电子邮件类,你可以这样做...

     // in the controller
 `$para = $usuario; 
  $asunto = "Asunto";
  $mensaje_correo = "<html lang='es'><head><title>Title</title></head>      <body>Contenido<br><a href=''> Activar </a></body></html>";                        
// to send a email with html mail, the header content-type most fixed
 $cabeceras = "MIME-Version: 1.0"."\r\n";
 $cabeceras .= 'Content-type: text/html;charset=iso-8859-1'."\r\n";
// aditional headers
 $cabeceras .= 'From: LACETEL <correo.domain.com>'."\r\n";
 //then I send email
 // the config file 
 $config['protocol'] = 'smtp'; 
 $config['mailpath'] = '/usr/sbin/sendmail';
 $config['charset'] = 'iso-8859-1';
 $config['mailtype'] = 'html';
 $config['wordwrap'] = FALSE;
 $config['protocol'] = 'smtp';
 $config['smtp_host'] = 'your host name';
 $config['smtp_port'] = your port number;
 $config['smtp_user'] = 'your mail';
 $config['smtp_pass'] = 'yor password mail';
` 

希望对你有用

【讨论】:

    猜你喜欢
    • 2014-12-03
    • 1970-01-01
    • 2015-11-29
    • 1970-01-01
    • 2018-04-27
    • 1970-01-01
    • 2016-05-10
    • 1970-01-01
    • 2016-02-18
    相关资源
    最近更新 更多