smtp

PHP利用qq邮箱发邮件

折月煮酒 提交于 2020-02-16 10:03:10
1.下载代码源码 https://github.com/PHPMailer/PHPMailer 2.在代码中放入composer.phar 安装phpmailer/phpmailer 3.到qq邮箱配置 开启SMTP服务 4.记住授权码 4.下载好phpmailer 后只需要几个重要的文件即可,其余的都可以删除 class.phpmailer.php class.pos3.php class.smtp.php 4.将这三个文件重新放置 有用的只有圈起来的三部分 5.编写发送邮件代码,封装在functions.php <?php /** * Created by PhpStorm. * User: xym * Date: 2018/7/27 * Time: 下午3:28 */ /*发送邮件方法 *@param $to: 接收者 $title: 标题 $content: 邮件内容 *@return bool true: 发送成功 false: 发送失败 */ function sendMail($to, $title, $content) { //引入PHPMailer的核心文件 使用require_once包含避免出现PHPMailer类重复定义的警告 require_once("phpmailer/class.phpmailer.php"); require_once(

Spring mvc之 发邮件(qq.163...)

时光毁灭记忆、已成空白 提交于 2020-02-15 04:03:17
一、 邮件开发涉及到的一些基本概念 1.1、邮件服务器和电子邮箱   要在Internet上提供电子邮件功能,必须有专门的电子邮件服务器。例如现在Internet很多提供邮件服务的厂商:sina、sohu、163、qq等等他们都有自己的邮件服务器。   这些邮件服务器类似于现实生活中的邮局,它主要负责接收用户投递过来的邮件,并把邮件投递到邮件接收者的电子邮箱中。   电子邮箱(E-Mail地址)的获得需要在邮件服务器上进行申请,确切地说,电子邮箱其实就是用户在邮件服务器上申请的一个账户,用户在邮件服务器上申请了一个帐号后,邮件服务器就会为这个账号分配一定的空间,用户从而可以使用这个帐号以及空间发送电子邮件和保存别人发送过来的电子邮件。 1.2、邮件传输协议 1.2.1、SMTP协议   (官方解释) SMTP 的全称是“Simple Mail Transfer Protocol”,即简单邮件传输协议。它是一组用于从源地址到目的地址传输邮件的规范,通过它来控制邮件的中转方式。SMTP 协议属于 TCP/IP 协议簇,它帮助每台计算机在发送或中转信件时找到下一个目的地。SMTP 服务器就是遵循 SMTP 协议的发送邮件服务器。   SMTP 认证,简单地说就是要求必须在提供了账户名和密码之后才可以登录 SMTP 服务器,这就使得那些垃圾邮件的散播者无可乘之机。   增加 SMTP

Net SMTP QQ 发送邮件

左心房为你撑大大i 提交于 2020-02-14 20:15:38
调用DEMO var currUser = new List<string> { "123@qq.com" , "123@qq.com" , "123@qq.com" };// 单个 var title = "test"; var content = "hello word"; mh.SendSMTPEMail(currUser, title, content);    方法: public class MailHelper { private string emailAcount = ConfigurationManager.AppSettings["EmailAcount"]; private string emailPassword = ConfigurationManager.AppSettings["EmailPassword"]; private string emailSmart = ConfigurationManager.AppSettings["EmailSmart"]; public void SendSMTPEMail(string strto, string strSubject, string strBody) { System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient

如何得到发送邮件服务器地址(SMTP地址)?

时光怂恿深爱的人放手 提交于 2020-02-13 02:22:17
邮件自动群发通内部已经内置了很多常用的SMTP地址,会根据你录入的账户邮件地址自动选择,如果没有将为你推荐一个。 一般的SMTP服务器地址是在邮箱地址前增加smtp,比如 email@126.com 的SMTP地址是 smtp.126.com。也有例外的,如果你用的是网站自带的邮箱,SMTP地址需要咨询一下你的网站提供商,一般常用的有下面几种,比如你的网站域名是www.yourdomain.com,那么SMTP服务器可能是下面之一 smtp.yourdomain.com mail.yourdomain.com smtp.mail.yourdomain.com 下面是一些常用邮箱的POP3 / SMTP地址。 特别提示:有些SMTP配置可能已经有所变化,具体请查询邮件服务器提供商 网易163邮箱 POP3:pop.163.com SMTP:smtp.163.com 网易vip.163邮箱 POP3:pop.vip.163.com SMTP:smtp.vip.163.com 网易126邮箱 POP3:pop.126.com SMTP:smtp.126.com 网易188邮箱 POP3:pop.188.com SMTP:smtp.188.com 网易yeah.net邮箱 POP3:pop.yeah.net SMTP:smtp.yeah.net 网易netease.com邮箱 POP3

使用Python发送邮件

大憨熊 提交于 2020-02-11 18:34:57
import smtplib from email.mime.text import MIMEText from email.header import Header # 第三方 SMTP 服务 mail_host = "smtp.163.com" # 设置服务器 mail_user = "AAAAAA@163.com" # 发邮件的账户名 mail_pass = "******" # 授权码 sender = 'AAAAAA@163.com' receivers = ['BBBBBB@qq.com'] # 接收邮件,可设置为你的QQ邮箱或者其他邮箱 # 三个参数:第一个为文本内容,第二个设置格式,plain:文本,html:HTML格式,第三个 utf-8 设置编码 message = MIMEText('本次邮件的内容', 'plain', 'utf-8') message['From'] = Header("AAAAAA@163.com") # 邮件中的发件人 message['To'] = Header("BBBBBB@qq.com") # 邮件中的收件人 subject = '邮件主题' message['Subject'] = Header(subject, 'utf-8') try: smtpObj = smtplib.SMTP() smtpObj.connect

Python发送邮件

限于喜欢 提交于 2020-02-11 14:30:28
Python发送邮件 SMTP(Simple Mail Transfer Protocol)简单邮件传输协议 MTA:邮件传送代理 SMTP协议只能发送邮件不能用来接收邮件 SMTP协议默认TCP端口号:25 工作形式: 1.客户-->服务器 2.服务器-->服务器 POP3(Post Office Protocol):传输工作协议 IMAP(Internet Message Access Protocol):交互式邮件存取协议 POP3协议为用户提供一种简单、标准的方式来访问邮箱和获取电邮 工作过程:连接服务器、获取所有信息并保存在用户主机、从服务器删除这些消息然后断开连接。 POP3协议的默认TCP端口号是110。 IMAP协议提供方便的邮件下载服务,可以让用户离线阅读。 IMAP协议默认TCP端口号是143。 邮件格式: 收件人 收件人 主题 邮件正文 Email email.mime.text.MIMEText 配置文件: #coding = utf-8 import smtplib #导入简单邮件传输协议库 from email.mime.text import MIMEText msg = MIMEText('Python发送的邮件','plain','utf-8') msg['Subject']='Letter of Python' msg['From']='****

Python发送简单SMTP邮件

怎甘沉沦 提交于 2020-02-06 17:21:35
一篇电子邮件基本上包含以下几个部分: (1) 源邮件地址/目的邮件地址,就是你自己的邮箱账号和对方的邮箱账号。 (2) 发件人/收件人,这个类似于下面这种图: 好像在QQ邮箱或163邮箱内可以自己设置名称。 (3) 主题,这个不用说了,可以为空。 (4) 正文。 (5) 附件 以下我们根据以上部分,使用python的smtplib和email模块模拟一封 验证码邮件 的发送。 一、介绍 1、smtplib模块 这个模块是Python自带模块,可直接导入。该模块使用了邮件中的SMTP协议,并进行了简单封装,常用以下函数: (1) SMTP()函数,创建smtp对象 (2) login()函数,登录邮箱 (3) sendmail()函数,发送邮件 (4) quit()函数,结束当前会话 2、email模块 也是Python的自带模块。本篇中,我们主要使用mime(Multipurpose Internet Mail Extensions)模块,称为多用途互联网邮件扩展类型,用于建立邮件体对象(主题、正文、附件等)。 (1) MIMEMultipart(),建立一个邮件体对象,为总体,其他小的部分(图片、文字、文件等都要往里面添加)。 (2) MIMEText(),建立文本对象。 (3) MIMEImage,建立图片对象。 (4) MIMEApplication,建立文件附件封装对象。

Not able to connect to smtp from Azure Cloud Service

守給你的承諾、 提交于 2020-02-06 09:37:48
问题 we are having 2 cloud services hosted on Azure. Both the services depend on our smtp server for sending mails. Problem is azure cloud service not able to connect to our smtp server. we are able to use same code on internal machines without any issue. also we had checked that 25 port is open and IP address are also not on blacklist. Below is the error while connecting from cloud service : A connection attempt failed because the connected party did not properly respond after a period of time,

Not able to connect to smtp from Azure Cloud Service

自作多情 提交于 2020-02-06 09:37:07
问题 we are having 2 cloud services hosted on Azure. Both the services depend on our smtp server for sending mails. Problem is azure cloud service not able to connect to our smtp server. we are able to use same code on internal machines without any issue. also we had checked that 25 port is open and IP address are also not on blacklist. Below is the error while connecting from cloud service : A connection attempt failed because the connected party did not properly respond after a period of time,

Send email in VB.Net with tls enabled server

一笑奈何 提交于 2020-02-06 08:44:17
问题 I am developing application for sending an email with TLS enabled SMTP server and this application I want to run on windows server 2003. When I run this same application on window server 2012 R2 its working perfect but it wont work on window server 2003. Is there any specific reason it wont work on window server 2003? Error: SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated. I used below code in my