phpmailer

PHP使用PHPMailer发送邮件

对着背影说爱祢 提交于 2019-12-17 20:22:17
1.下载PHPMailer代码包 PHPMailer项目地址:https://github.com/PHPMailer/PHPMailer 使用git clone命令克隆到本地,或直接点击 Download ZIP 获取到完整的PHPMailer代码包。 2.将下载的PHPMailer的包解压后部署到项目中 这里主要是src这个文件中的PHPMailer.php和SMTP.php这两个文件 3.准备好要发送和接收的邮箱(QQ邮箱或163邮箱) 进入QQ邮箱,点击页面左上方“设置”,再点击“邮箱设置”下的“账户”选项卡,拖动滚动条,即可看到POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务,将所有服务都进行开启,然后点击下面的生成授权码按钮,按照提示生成授权码,记录授权码(后面要用到)。(163邮箱也是类似这样的操作) 4.扩展准备 PHPMailer需PHP的socket扩展支持,而PHPMailer链接qq域名邮箱时需要ssl加密方式(qq邮箱做了限制,只允许ssl的465或587端口,所以php还得openssl的支持,可以查看phpinfo,或者在Linux窗口用php -m 查看 5.开启465端口 这里可以登录服务器,查看安全组是否开启465端口,如果没有记得开启一下 6.引入资源文件 主要是引用PHPMailer.php和SMTP

mail delivered as spam - phpmailer, how to avoid

荒凉一梦 提交于 2019-12-17 18:51:34
问题 I know that in first look many users mark this question as duplicate, but after reading more than 10 question I did not get any satisfactory answer, almost all question has answers having words like "There's not much you can do about it.", "I am not sure", "There is no sure shot trick" etc. that's why I am writing this question, and I think this is very generalized questions and every php developer faces it at least once, ok enough speech :) , now my question is.. I working on a project

PHPMailer character encoding issues

╄→尐↘猪︶ㄣ 提交于 2019-12-17 17:21:27
问题 I try to use PHPMailer to send registration, activation. etc mail to users: require("class.phpmailer.php"); $mail -> charSet = "UTF-8"; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtp.mydomain.org"; $mail->From = "name@mydomain.org"; $mail->SMTPAuth = true; $mail->Username ="username"; $mail->Password="passw"; //$mail->FromName = $header; $mail->FromName = mb_convert_encoding($header, "UTF-8", "auto"); $mail->AddAddress($emladd); $mail->AddAddress("mytest@gmail.com"); $mail-

PHPMailer cannot send email

主宰稳场 提交于 2019-12-17 17:16:06
问题 My project contains a function to send email, being PHPMailer . It runs well to send email from my localhost server, but it stopped sending email today, and now it shows this error message SMTP Error: Could not connect to SMTP host. I added this code $mail->SMTPDebug = 1; to view debug errors and is now showing me this message: SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found. (0)

Send mail in phpmailer using DKIM Keys

瘦欲@ 提交于 2019-12-17 15:36:47
问题 Currents i am using phpmailer to send mail's. now how its possible to send email in phpmailer with DKIM keys i search in phpmailer Class file and i found the below code /** * DKIM selector. * @type string */ public $DKIM_selector = ''; /** * DKIM Identity. * Usually the email address used as the source of the email * @type string */ public $DKIM_identity = ''; /** * DKIM passphrase. * Used if your key is encrypted. * @type string */ public $DKIM_passphrase = ''; /** * DKIM signing domain name

PHPmailer sending mail to spam in hotmail. how to fix?

落花浮王杯 提交于 2019-12-17 15:35:19
问题 I'm using the phpmailer class to send emails. Currently gmail and yahoo do not mark emails as spam, but hotmail always does. How can I prevent this? My code is below. require_once('../PHPMailer/class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "mail.example.com"; // specify main and backup server $mail->SMTPAuth = true; // turn on

PHPMAILER Not sending and not giving error

心已入冬 提交于 2019-12-17 12:46:12
问题 I am trying to let users fill out a contact form, which will then be sent to my email. But its not working for some reason. I just get a blank page with no error message or any text and email is also not sent. if (isset($_POST['submit'])) { include_once('class.phpmailer.php'); $name = strip_tags($_POST['full_name']); $email = strip_tags ($_POST['email']); $msg = strip_tags ($_POST['description']); $subject = "Contact Form from DigitDevs Website"; $mail = new PHPMailer(); $mail->IsSMTP();

使用PHPMAILER实现PHP发邮件功能

ぐ巨炮叔叔 提交于 2019-12-17 12:30:04
第一步: 打开网址https://github.com/PHPMailer/PHPMailer/ 下载PHPMailer,PHPMailer 需要 PHP 的 sockets 扩展支持,而登录 QQ 邮箱 SMTP 服务器则必须通过 SSL 加密的, PHP 还得包含 openssl 的支持。 第二步:使用 phpinfo() 函数查看 socket 和 openssl 扩展信息(wamp server 默认启用了该扩展)。 openssl 如果没有开启请打开php.ini文件进行开启 首先检查php.ini中;extension=php_openssl.dll是否存在, 如果存在的话去掉前面的注释符‘;’, 如果不存在这行,那么添加extension=php_openssl.dll。 PHPMailer 核心文件 第三步: QQ 邮箱设置 所有的主流邮箱都支持 SMTP 协议,但并非所有邮箱都默认开启,您可以在邮箱的设置里面手动开启。 第三方服务在提供了账号和密码之后就可以登录 SMTP 服务器,通过它来控制邮件的中转方式。 第四步:开启 SMTP 服务 选择 IMAP/SMTP 服务,点击开启服务 第五步:验证密保 发送短信“配置邮件客户端”至1069-0700-69 第六步:获取授权码 SMTP 服务器认证密码,需要妥善保管(PS:密码直接没有空格) 第七步:PHP发送邮件

require(vendor/autoload.php): failed to open stream

安稳与你 提交于 2019-12-17 08:14:04
问题 I know that this issue has been posted many times, but for me it seems to be a different problem. Indeed, this error Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\site_web\send_mail.php on line 3 Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\site_web\send_mail.php on line 3 appears at the begining of my code from this line: require 'vendor/autoload.php';

PHPMailer GoDaddy Server SMTP Connection Refused

时光总嘲笑我的痴心妄想 提交于 2019-12-17 02:12:23
问题 The other day I was experiencing some problems with my GoDaddy hosted site. I called their tech support, and the person that I spoke with suggested that my problems were related to the fact that I was on a Windows box and would be better served on a Linux box. Having no opinion on this, I agreed and they switched me over. In the wake of that transition, my PHPMailer functionality has deserted me. I have had this working for months, so I know that my settings are accurate. I have confirmed