【发布时间】:2019-03-28 15:29:27
【问题描述】:
我正在尝试什么
我正在构建一个 codeigniter 应用程序并且需要发送邮件。当我尝试从 localhost 发送邮件时,我的邮件配置运行良好。但是在服务器上托管时它不起作用。
邮件配置
var $useragent = "CodeIgniter";
var $mailpath = "/usr/sbin/sendmail"; // Sendmail path
var $protocol = "smtp"; // mail/sendmail/smtp
var $smtp_host = "send.one.com"; // SMTP Server. Example: mail.earthlink.net
var $smtp_user = "no-reply@domain.com"; // SMTP Username
var $smtp_pass = "pass"; // SMTP Password
var $smtp_port = "25"; // SMTP Port
var $smtp_timeout = 60; // SMTP Timeout in seconds
var $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl.
var $wordwrap = TRUE; // TRUE/FALSE Turns word-wrap on/off
var $wrapchars = "76"; // Number of characters to wrap at.
var $mailtype = "html"; // text/html Defines email formatting
var $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii
var $multipart = "mixed"; // "mixed" (in the body) or "related" (separate)
var $alt_message = ''; // Alternative message for HTML emails
var $validate = FALSE; // TRUE/FALSE. Enables email validation
var $priority = "1"; // Default priority (1 - 5)
var $newline = "\r\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822)
var $crlf = "\r\n";
从服务器发送时出现以下错误
A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to send.one.com:25 (Connection timed out)
Filename: libraries/Email.php
Line Number: 1689
应用程序托管在 one.com 上
【问题讨论】:
标签: codeigniter email