(1/1) Swift_TransportException
Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients
邮件的发件人名称与邮件的from 邮箱地址对应
xiaojian => xiaojian@163
[2019-06-21T04:04:15.878] [DEBUG] default - { component: 'smtp-connection', sid: 'kzpfkQU1PEM', tnx: 'smtp' } 'Closing connection to the server using "%s"' 'end'
[2019-06-21T04:04:15.879] [ERROR] default - { component: 'mail',
err: { Error: self signed certificate
at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
at emitNone (events.js:106:13)
it (events.js:208:7)
at TLSSocket._finishInit (_tls_wrap.js:639:8)
at handshakedone (_tls_wrap.js:469:38) code: 'ESOCKET', command: 'CONN' },
tnx: 'transport',
action: 'send' } 'Send Error: %s' 'self signed certificate'
配置项中添加 "ignoreTLS": true, 即可
ateTransport = function() {ansport = ateTransport({"service": ail.service,"auth": {"user": ail.user,"pass": ail.pass},"logger": logger,"host": ail.host,"port": ail.port,"secure": ail.secure,"ignoreTLS": true,});logger.debug('SMTP configured');return this;
};
.php/how-do/bfIL/nodejs-nodemailer-nodemailer-depth-zero-self-signed-cert
service.json
{"1und1": {"host": "smtp.1und1.de","port": 465,"secure": true,"authMethod": "LOGIN"},"AOL": {"domains": ["aol"],"host": "smtp.aol","port": 587},"DebugMail": {"host": "debugmail.io","port": 25},"DynectEmail": {"aliases": ["Dynect"],"host": "smtp.dynect","port": 25},"FastMail": {"domains": ["fastmail.fm"],"host": "smtp.fastmail","port": 465,"secure": true},"GandiMail": {"aliases": ["Gandi", "Gandi Mail"],"host": "mail.gandi","port": 587},"Gmail": {"aliases": ["Google Mail"],"domains": ["gmail", "googlemail"],"host": ail","port": 465,"secure": true},"Godaddy": {"host": "smtpout.secureserver","port": 25},"GodaddyAsia": {"host": "smtp.asia.secureserver","port": 25},"GodaddyEurope": {"host": "smtp.europe.secureserver","port": 25},": {"host": ""},"Hotmail": {"aliases": ["Outlook", "Outlook", "Hotmail"],"domains": ["hotmail", "outlook"],"host": "smtp.live","port": 587},"iCloud": {"aliases": ["Me", "Mac"],"domains": ["me", "mac"],"host": "","port": 587},": {"host": ""},"Mail.ru": {"host": "smtp.mail.ru","port": 465,"secure": true},"Maildev": {"port": 1025,"ignoreTLS": true},"Mailgun": {"host": "smtp.mailgun","port": 465,"secure": true},"Mailjet": {"host": "in.mailjet","port": 587},"Mailosaur": {"host": "mailosaur.io","port": 25},"Mailtrap": {"host": "smtp.mailtrap.io","port": 2525},"Mandrill": {"host": "smtp.mandrillapp","port": 587},"Naver": {"host": "smtp.naver","port": 587},"One": {"host": ","port": 465,"secure": true},"OpenMailBox": {"aliases": ["OMB", "openmailbox"],"host": "smtp.openmailbox","port": 465,"secure": true},"Outlook365": {"host": "smtp.office365","port": 587,"secure": false},"Postmark": {"aliases": ["PostmarkApp"],"host": "smtp.postmarkapp","port": 2525},"qiye.aliyun": {"host": hichina","port": "465","secure": true},"QQ": {"domains": ["qq"],"host": "smtp.qq","port": 465,"secure": true},"QQex": {"aliases": ["QQ Enterprise"],"domains": ["exmail.qq"],"host": ail.qq","port": 465,"secure": true},"SendCloud": {"host": "smtpcloud.sohu","port": 25},"SendGrid": {"host": "smtp.sendgrid","port": 587},"SendinBlue": {"host": "smtp-relay.sendinblue","port": 587},"SendPulse": {"host": "smtp-pulse","port": 465,"secure": true},"SES": {"host": "email-smtp.us-east-1.amazonaws","port": 465,"secure": true},"SES-US-EAST-1": {"host": "email-smtp.us-east-1.amazonaws","port": 465,"secure": true},"SES-US-WEST-2": {"host": "email-smtp.us-west-2.amazonaws","port": 465,"secure": true},"SES-EU-WEST-1": {"host": "email-smtp.eu-west-1.amazonaws","port": 465,"secure": true},"Sparkpost": {"aliases": ["SparkPost", "SparkPost Mail"],"domains": ["sparkpost"],"host": "smtp.sparkpostmail","port": 587,"secure": false},"Tipimail": {"host": "smtp.tipimail","port": 587},"Yahoo": {"domains": ["yahoo"],"host": "smtp.mail.yahoo","port": 465,"secure": true},"Yandex": {"domains": ["yandex.ru"],"host": "smtp.yandex.ru","port": 465,"secure": true},"Zoho": {"host": ho","port": 465,"secure": true,"authMethod": "LOGIN"},"126": {"host": "smtp.126","port": 465,"secure": true},"163": {"host": "smtp.163","port": 465,"secure": true}
}
nodermailer 如果使用自己配置的mail服务:
node_modules/nodemailer/lib/well-known/services.json
需要添加以下内容
"myservice": {"host": aliyun.club","port": 25,"secure": false}
public function test(Request $request) {$mail = new Mail();$mail->mailto = 'xxx@samplehost';$mail->title = 'test smtp.samplehost';$mail->body = 'This is test send';return $mail->send();
}
* Mail.php
<?php
/*** Created by PhpStorm.* User: mingzhanghui* Date: 1/21/2019* Time: 16:16*/namespace App;use AppJobsProcessMail;
use IlluminateDatabaseEloquentModel;
use IlluminateSupportFacadesLog;
use IlluminateSupportFacadesQueue;class Mail extends Model {protected $table = 'mail';protected $fillable = ['mailto','title','body'];protected $guarded = ['id'];public $timestamps = true;public function send() {// read config from fig$config = new Config();$enabled = $config->get('MAIL_ENABLED');if ($enabled == '0') {Log::info("