phpmailer

监控503错误的好用方法

半腔热情 提交于 2019-11-27 07:38:38
分享一例php代码,用于监控日志中的500、503错误,并发送提示邮件,有需要的朋友参考下吧。也可以直接使用iis7服务器监控工具开启503错误监控: 本例代码,基于phpmailer类实现,设置个计划任务执行,自己设置要监控的错误代码。 可用于排查服务器问题,检测iis默认日志、nginx日志等,请根据自己的需要做修改。 有关phpmailer类的用法,请参考文章: 例子: 复制代码 代码示例: <?php /** * 监控日志 500 503错误 * by www.jbxue.com */ include("PHPMailer/class.phpmailer.php"); //error_reporting(0); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 1; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp.126.com"; // sets

PHPmailer gmail 'from' is gmail account

独自空忆成欢 提交于 2019-11-27 07:15:22
问题 I'm trying to send a mail with PHPmailer and gmail. But when I send a mail its from my gmail account instead of no-reply. How do I set no-reply as from? Code I have: $mail = new PHPMailer(); $mail->Mailer = "smtp"; $mail->Host = "ssl://smtp.gmail.com"; $mail->Port = 465; $mail->SMTPAuth = true; $mail->Username = "myAccount@web.com"; $mail->Password = "password"; $mail->From = "no-reply@web.com"; $mail->AddAddress($to); $mail->AddReplyTo("no-reply@web.com","no-reply"); $mail->Subject =

Phpmailer using smtp with Gmail not working - connection timing out

一个人想着一个人 提交于 2019-11-27 07:12:58
问题 I've looked into the following links: phpmailer send gmail smtp timeout send email using Gmail SMTP server through PHP Mailer http://uly.me/phpmailer-and-gmail-smtp/ ...and tried to implement for myself a combination of those however...most of the time it sends this message... Message could not be sent. Mailer Error: SMTP connect() failed. However there was one time where it sent this when I experimented between "tls" and "ssl"... SMTP ERROR: Failed to connect to server: Connection timed out

Should I use php mail function or phpmailer?

耗尽温柔 提交于 2019-11-27 06:59:35
问题 Well, so far, I have been using php built in function, mail(), and I have no problems with it, even I sent a blast to 1000+ users. But then, lately I found this phpmailer, which is specially design to send email. Q1: Should I change to this phpmailer? Q2: What are the advantages of using phpmailer? Q3: I found other products on phpmailer website, i.e phpmailer FE, ML etc. What are those? Which one you guys is using? Q4: Have anyone tried sending blast email to 2000+ users with phpmailer? If

PHP mailer error

别来无恙 提交于 2019-11-27 06:47:39
问题 I tried to use php mailer but errors as follows. SMTP -> FROM SERVER: SMTP -> FROM SERVER: SMTP -> ERROR: EHLO not accepted from server: SMTP -> FROM SERVER: SMTP -> ERROR: HELO not accepted from server: SMTP -> ERROR: AUTH not accepted from server: SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate. Message could not be sent. Mailer Error: SMTP Error: Could not authenticate. and my code <?php require("class.phpmailer.php") $mail = new PHPMailer(); $mail-

PHP mailer multiple address [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-11-27 06:13:37
Possible Duplicate: PHPMailer AddAddress() Here is my code. require('class.phpmailer.php'); $mail = new PHPMailer(); $email = 'email1@test.com, email2@test.com, email3@test.com'; $sendmail = "$email"; $mail->AddAddress($sendmail,"Subject"); $mail->Subject = "Subject"; $mail->Body = $content; if(!$mail->Send()) { # sending mail failed $msg="Unknown Error has Occured. Please try again Later."; } else { $msg="Your Message has been sent. We'll keep in touch with you soon."; } } The Problem if $email value is only 1. It will send. But multiple don't send. What should I do for this. I know that in

PHPMailer, AddStringAttachment and Data URI Scheme

六月ゝ 毕业季﹏ 提交于 2019-11-27 06:04:37
问题 I have converted the contents of a canvas element to data (URI Scheme) using toDataURL() ( $contact_image_data ) and I want to send this via email as an attachment. This is currently how I have PHPMailer set up: $contact_image_data="data:image/png;base64,iVBORw0KGgo[...]"; $filename="test.png"; $encoding = "base64"; $type = "image/png"; $mail->AddStringAttachment($contact_image_data, $filename, $encoding, $type); I am wondering if this is actually possible, and if so, what steps I am missing.

PHPMailer attachment, doing it without a physical file

ε祈祈猫儿з 提交于 2019-11-27 05:24:46
So: // Setup mail class, recipients and body $mailer->AddAttachment('/home/mywebsite/public_html/file.zip', 'file.zip'); The AddAttachment function has four arguments: AddAttachment(PATH_TO_FILE, FILENAME, ENCODING, HEADER_TYPE) I used to use xmail() and when I added a attachment here, I passed the filename and the content, that should be in it. Like this: $xmail->addAttachment('myamazingfile.pdf', $content); How can I make it work the same way, so when i call AddAttachment() from the PHPmailer class, I can either pass the same or something like it, so I dont need to have a actual file on my

“Password not accepted from server: 535 Incorrect authentication data” when sending with GMail and phpMailer

こ雲淡風輕ζ 提交于 2019-11-27 04:00:07
问题 I have the same php script running on localhost - my PC with XAMPP and on a hosted server. It works from my PC, but not from the hosted server. When I send it from the hosted server, I get the following output: SMTP -> ERROR: Password not accepted from server: 535 Incorrect authentication data SMTP -> ERROR: RCPT not accepted from server: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message. dev.camppage.com 550-

Could not connect to SMTP host

被刻印的时光 ゝ 提交于 2019-11-27 03:55:56
问题 SMTP Error: Could not connect to SMTP host. Message could not be sent. Mailer Error: SMTP Error: Could not connect to SMTP host. I can't seem to find a way to make PHPMailer work under CentOS. Mail work just fine under Windows with XAMPP but I always get this error under Linux. The SMTP server is a Lotus Domino listening on port 25, CentOS machine has NO firewall at all and the strange thing is that even mail() does not work. It returns nothing (while on Windows returns 1). If I send an email