草庐IT

smtpConnect

全部标签

PHP 自定义 SMTP 邮件函数返回错误 fputs 发送字节失败 errno=32 Broken pipe

我编写了下一个自定义PHP函数来通过SMTP邮件服务器发送邮件。functionsend($format='text'){$smtpServer='mail.mymailserver.com.mx';$port='25';$timeout='60';$username='myuser';$password='mypassword';$localhost='www.mydomain.com.mx';$newLine="\r\n";$smtpConnect=fsockopen($smtpServer,$port,$errno,$errstr,$timeout);fputs($smtpCon