phpmailer

How to set a custom header using phpmailer

旧时模样 提交于 2019-12-06 20:26:02
问题 I am using phpmailer for sending emails, but I want to make a custom header for my company, by adding a textarea field that contain any custom header for example using a header like this one: exemple of header or any other header types.. How can I do this , thanks in advance. 回答1: You will need to do some discovery and modification of the default headers set by PHPmailer for this to be achieved. You will need to use different functions to set/edit headers depending on the type of header you

最详细的phpmailer的使用方法

强颜欢笑 提交于 2019-12-06 20:15:14
第一,需要下载PHPMailer文件包phpmailer,PHPMailer 非常小巧、简单、方便、快捷。 第二,确认你的服务器系统已经支持socket ,通过phpinfo();查看是否支持sockets(socket 是属于PHP扩展部分),如果显现为“enabled”,那就是支持了。 第三,把文件解后找到class.phpmailer.php 、class.smtp.php两个类放到自己的目录下!调用类就可以了. 首先包含class.phpmailer.php,然后创建对象,设置参数,调用成员函数。 例1,做成函数方便调用 <?php require("phpmailer/class.phpmailer.php"); function smtp_mail( $sendto_email, $subject, $body, $extra_hdrs, $user_name){ $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "200.162.244.66"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "yourmail"; // SMTP

phpmailer timeout not working

送分小仙女□ 提交于 2019-12-06 16:39:32
i use phpmailer to send mail,and i want to get the result,because send mail is very frequently. so i want to use phpmailer "timeout" .but is not working. my code $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Timeout = 10; $mail->SMTPAuth = true; $mail->SMTPKeepAlive = true; $mail->SMTPSecure = "ssl"; $mail->Host = "smtp.gmail.com"; $mail->Port = 465; $mail->Username = "qinqin1920@gmail.com"; $mail->Password = "xxxx"; $mail->From = "qinqin1920@gmail.com"; $mail->Subject = "This is the subject"; $mail->AltBody = "test"; //$mail->WordWrap = 50; // set word wrap $mail->MsgHTML("test233"); //

php send mail form not working with emails on same domain [closed]

你。 提交于 2019-12-06 16:18:06
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I am trying to add a contact form to a website which posts the form data to an email address. It works fine with any other email registrants like Gmail and Yahoo. but it doesn't work with emails with same domain name (e.g.: info@domain.com or support@domain.com). The same form was

Receiving Spam from my Form Using PHPMailer

白昼怎懂夜的黑 提交于 2019-12-06 15:10:14
I am coming to stackoverflow for this because everything I search pretty much talks about email from a form using PHPMailer going to a users spam box. But, I need info on receiving spam from the form itself. I use it on a small, very light traffic real estate agents website. She gets spam from time to time and I don't know how to resolve it. PHPMailer seems to be the go to tool for sending email with PHP, so I figure spam/security is pretty well covered. I must be doing something wrong.... I am using class.phpmailer.php of course, and here is my code: if ($_SERVER["REQUEST_METHOD"] == "POST")

PHPMailer 发送邮件

僤鯓⒐⒋嵵緔 提交于 2019-12-06 14:39:55
下载PHPMailer,下载完成会出现vendor文件夹 vendor文件夹内有下载好的phpmailer phpmailer需要打开php.ini的 sockets 扩展和 openssl 的扩展。 创建sendemail.html和sendemail.php放在和vendor同一目录下 文件sendemail.php,需要补充发件人邮箱和授权码 1 <?php 2 // Import PHPMailer classes into the global namespace 3 // These must be at the top of your script, not inside a function 4 use PHPMailer\PHPMailer\PHPMailer; 5 use PHPMailer\PHPMailer\SMTP; 6 use PHPMailer\PHPMailer\Exception; 7 8 header("Content-Type: text/html; charset=utf-8"); 9 sendemail($_POST['addressee'], $_POST['address'], $_POST['title'], $_POST['content']); 10 11 function sendemail($addressee,

PHP Mailer - SMTP GMAIL AUTHENTICATION

拥有回忆 提交于 2019-12-06 11:38:07
问题 I have problem with the PHP MAILER function. I am using GMAIL SMTP Authentication for sending email and also its working perfectly but i want to set "From" email like "myid@domainname.com" but it doesn't working properly. I used below code to set "From" email $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "mail.gmail.com"; // SMTP server $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP

How to use variables in phpmailer message body

半腔热情 提交于 2019-12-06 10:02:00
I'm editing a form and I want to receive as mail when users fill it and send it. I received variables on mail before, such like: Name: $name. Now contact.php returns a blank page and I can't receive the form as mail. I tried before that, $body_message = 'Name: ' . $name . "\r\n"; $body_message .= 'E-mail: ' . $mail_from . "\r\n"; $body_message .= 'Message: ' . $message; But it doesn't work. And that also, $mail->Body = '<b>You have a reservation!</b> Name: $name Surname: $surname Phone: $phone Mail: $mail Address: $address Services: $check '; Now my code: $name = $_POST['name']; $surname = $

Mailer Error: SMTP Error: data not accepted

岁酱吖の 提交于 2019-12-06 09:41:17
I want to send mail through PHP, so i am using PHPMailer. Don't know why i am getting this error. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Relaying not allowed - sender domain not local SMTP code: 530 This is my code. require '../library/PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->IsSMTP(); //From email address and name $mail->From = "my@email.address"; $mail->FromName = "Full Name"; //To address and name $mail->addAddress("my@email.address", "Recipient Name"); //$mail->addAddress("recepient1@example.com"); //Recipient

Failed to connect to server: Connection refused (111)

给你一囗甜甜゛ 提交于 2019-12-06 09:03:51
问题 I am using PHPMailer to send the smtp emails. If I use the same setting in a WordPress site, it works fine. But my priority is to use in a custom php page. And there, it is giving the following errors SMTP ERROR: Failed to connect to server: Connection refused (111) SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting My Code is here below <?php ini_set('display