phpmailer

Can I open socket in PHP from a specific IP (if the machine has two IPs)?

南楼画角 提交于 2019-12-05 20:55:18
I'm using PHPMailer and it uses fsockopen to access the SMTP server. But the machine has two IPs with different reverse DNS records. So in email headers I got the following: Received: from one-server.tld (HELO another-server.tld) ... I need to hide one-server.tld in favor of another-server.tld . But I need both IPs with their current RDNS settings. I think its not possible using fsockopen . But its possible in curl , fopen and stream functions. What you need is stream_socket_client() function. Here are some ways to achieve it. Using context parameters which can be used in fopen function family

PHPmailer without using SMTP

吃可爱长大的小学妹 提交于 2019-12-05 20:49:56
问题 I've added the PHPMailer folder to my root folder on my web server and I just get an error that has to do with SMTP. Is there a way to use PHPMailer without needing to log into a mail account? Can I just have the server send the email to a address? I was searching this site and found this $email = new PHPMailer(); $email->From = 'you@example.com'; $email->FromName = 'Your Name'; $email->Subject = 'Message Subject'; $email->Body = $bodytext; $email->AddAddress( 'destinationaddress@example.com'

how to send two different messages to two different users phpmailer

我是研究僧i 提交于 2019-12-05 17:24:08
I am sending mails to two different persons, two different messages one for user and one for admin. $message1='hello user' $message2='hello admin' $email = 'user@email.com' $adminemail = 'admin@email.com'; require 'PHPMailerAutoload.php'; $mail = new PHPMailer(true); $mail->isHTML(); $mail->IsSMTP(); $mail->setFrom('admin@mysite.com', 'admin site'); $mail->AddAddress( $email); $mail->Subject = $subject; $mail->Body =$message1; $mail->Send(); //message for admin $mail->Body =$message2; //$adminemail = $generalsettings[0]["admin_email"]; $mail->AddAddress($adminemail); $mail->Send(); But as a

PHPMailer: Using remote SMTP server, works under localhost, Connection refused (111) on remote server

混江龙づ霸主 提交于 2019-12-05 15:51:00
I've got a bizarre problem here. I'm trying to use PHPMailer to send an email, through SMTP. I have a website hosted by GoDaddy and it's that SMTP account that I'm trying to use to send the mail. It works if I execute my PHP file on my localhost server. It does not work if I execute my PHP file on GoDaddy's server. The error message I get is: SMTP -> ERROR: Failed to connect to server: Connection refused (111) I checked phpinfo on both localhost and the remote server. Both have smtp_port listed as 25 . I'm using WAMP on my machine and the server is some form of Linux (which I know nothing

PHP - file_get_contents() with variable in string?

让人想犯罪 __ 提交于 2019-12-05 15:17:12
Im trying to email an order with PHPMailer to the customer when this order is received. I tried doing that this way: $email_page = file_get_contents("email_order_html.php?order=$order_id"); I want to get the contents of this page as string so I can send this with PHPMailer but this function wont execute the page because of the variable $order_id in it, how can I fix this? You can only add Query Params when using file_get_contents with an Url Aware Stream Wrapper, e.g. it would work for http://localhost/yourfile.php?foo=bar . Doing so would issue an HTTP Get Request to a webserver at localhost

Sending 2 emails with PHP mailer fails

跟風遠走 提交于 2019-12-05 10:29:47
I am rather puzzled with this one. //SMTP servers details $mail->IsSMTP(); $mail->Host = "mail.hostserver.com"; $mail->SMTPAuth = false; $mail->Username = $myEmail; // SMTP usr $mail->Password = "****"; // SMTP pass $mail->SMTPKeepAlive = true; $mail->From = $patrickEmail; $mail->FromName = "***"; $mail->AddAddress($email, $firstName . " " . $lastName); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = $client_subject; $mail->Body = $client_msg; if($mail->Send()) { $mail->ClearAllRecipients(); $mail->ClearReplyTos(); $mail->ClearCustomHeaders(); ... $mail->From = "DO_NOT_REPLY@...";

get raw rfc822 message from phpmailer

冷暖自知 提交于 2019-12-05 10:23:33
I am trying to use google-api-php-client and gmail-api to allow my users to authenticate their gmail accounts and send emails through my website. I asked a more generic questions earlier and decided to seek help from the PHPMailer community with this question. I have used PHPMailer to send emails. And I want to know if I can extract the raw rfc822 message from my PHPMailer object after setting it up prior to sending. I should be able to then do a base64_encode on that string and set the "raw" property for my Google_Service_Gmail_Message. No problem: Set up everything as if you were going to

PHPMailer not sending CC or BCC

血红的双手。 提交于 2019-12-05 08:20:27
I have been testing the following code for hours. The email will send to the addresses added through $mail->AddAddress() and in the received email it states the cc but the person cced does not receive the email. I have looked everywhere and can not find a solution to why this is happening. I have run tests and all variables are being submitted to this code properly. My server is running Linux Red Hat My Code: require_once('../smtp/class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(true); //

SMTP ERROR: Failed to connect to server: Connection refused (111) ERROR MESSAGE

巧了我就是萌 提交于 2019-12-05 08:08:50
I'm new to PHPMailer , and I just downloaded it with Composer and coded this as index.php : <?php require_once 'vendor/autoload.php'; use PHPMailer\PHPMailer\PHPMailer; $m = new PHPMailer; $m->isSMTP(); $m->SMTPAuth = true; $m->SMTPDebug = 2; $m->Host = 'smtp.mail.yahoo.com'; $m->Username = 'vagefipooya@yahoo.com'; $m->Password = 'MY PASSWORD'; $m->SMTPSecure = 'ssl'; $m->Port = 465; $m->IsHTML(true); $m->SetFrom('pouyavey@gmail.com'); $m->FromName = 'Pouya Vaghefi'; $m->addReplyTo('pouyavey@gmail.com','Pouya Vey'); $m->addAddress('pouyavey@gmail.com','Pouya Vey'); //$m->addCC('alex@phpacademy

Sending Multiple Mails In PHP Mailer

故事扮演 提交于 2019-12-05 08:06:10
问题 I have been writing a trigger that mails an email using PHP mailer. The problem with the code is that it is sending multiple mails to a single recipient. I even tried using the function singleTo but even that didn't seem to work. $mail = new PHPMailer(); for($i = 0; $i <= sizeof($emailid); $i++) { $mail->WordWrap = 50; $mail->IsHTML(true); $mail->SingleTo = true; $mail->AddAddress($emailid[$i],$name[$i]); $mail->Subject = 'Some Subject'; $mail->Body = "Some Body"; $mail->AltBody = "Some Body"