如何在Windows系统中安装sendmail使用PHP mail函数
php mail()函数在windows不能用,需要安装sendmail。
1来实现发邮件。现在大部分邮箱都要求smtp验证,所以要在sendmail
smtp_port = 25
; For Win32 only
; For Unix only to your smtp server
smtp_server=smtp
smtp_port=25
auth_username=yourusername
auth_password=yourpassword
force_sender=zmacro@gmail
sendmail网上有下的,如果你是用xampp,那里面直接就带了。
同时在虚拟主机的httpd'</directory>
此邮件地址为用户的邮件地址,随便添。
------------------------
测试文件mail_test","测试","测试邮件"))
{
echo "发送成功!!";
}
else{
echo "发送失败!!";
}
?>
python smtp.sendmail问题
我从我以前的代码里摘了一段出去,你拿去用吧
import smtplib
import time
from email.mime.text import MIMEText
from email.header import Header
sender = 'test@test.com'
receiver = 'receiver@test.com'
subject = 'Tile'
smtpserver = 'mail.test.com'
username = 'test'
password = 'test'
def mail(*args):
msg = MIMEText(text, 'plain', 'utf-8')
msg['Subject'] = Header(subject, 'utf-8')
smtp = smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login(username, password)
smtp.sendmail(sender, receiver, msg.as_string())
smtp.quit()
if __name__ == 'main':
text = "test: \n" + line
mail(text, subject, smtpserver,username,password,sender,receiver)
JMail组件发送邮件错误
这是我的代码,能发送,希望对你能有用,
jmail.Message m = new jmail.Message();
m.Charset = "gb2312";
m.From = _sendMailAddress;
m.Subject = _Title;
m.AddRecipient(_ReceiverMailAddress, null, null);
m.MailServerUserName = UserName;
#region password
m.MailServerPassWord = Password;
#endregion
m.ContentType = "text/html";
m.Body = _Content;
m.Send("自己服务器的域", false);
mantis邮件设置不成功,无法注册新用户,请问怎么解决
邮件服务器配置
在Mantis中注册新用户时,会给你指定的邮箱发一封邮件,点开邮件中的链接才可以设定密码,因此需要给Mantis添加邮件功能。
使用phpmailer作为邮件服务器,首先下载phpmailer,网址为:http://phpmailer.codeworxtech.com,下载完后解压到c:\phpmailer。
修改C:\mantis-1.1.4\config_inc.php,添加以下内容:
$g_smtp_host = 'smtp.sina.com.cn';--------mantis发送邮件所需要的服务器
$g_smtp_username = 'xinqian3607';--------mantis登录的用户名
$g_smtp_password = '123456';---------密码
$g_use_phpMailer = ON;----------打开phpmailer
$g_phpMailer_path = 'c:/phpmailer/';----------保证phpmailer所安装的路径正确
$g_phpMailer_method = 2;-----------此处的数值可为0,1,2
0为调用了一个mantis内置的mail()函数来发送邮件;1为sendmail方式(这个我也不是很清楚);2为使用smtp方式,登录到邮件服务器内来发送邮件
$g_return_path_email = 'xinqian3607@sina.com'--------这个即带上了域名的完整邮箱名
把phpmailer这个下个新的,放到目录下,mantis里面自带的这个也留着
转载请注明出处51数据库 » odisendmailpassword