phpmailer

smtp gmail server php mailer not working

喜夏-厌秋 提交于 2019-12-02 09:40:54
I know this question has been asked many a times before. But the solutions didn't seem to help me . So hereby I am posting my code: <?php require("class.phpmailer.php"); require("class.smtp.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host="smtp.gmail.com"; $mail->SMTPDebug=1; $mail->SMTPAuth=true; $mail->SMTPSecure="ssl"; $mail->Port=465; $mail->Username ="me@gmail.com"; $mail->Password="mypassword"; $mail->AddAddress("to@yahoo.co.in"); $mail->SetFrom("me@gmail.com", "myname"); $mail->AddReplyTo("someone@gmail.com","someone"); $mail->Subject="Greetings from ME"; $mail->Body=

Could not connect to SMTP host. Message could not be sent

人走茶凉 提交于 2019-12-02 09:25:36
When I sent email from server then it gives me two error - SMTP Error: Could not connect to SMTP host. Message could not be sent. Mailer Error: SMTP Error: Could not connect to SMTP host. I found many hints on another answers on Stack overflow but doesn't work. I tried port no 465/587/65. Even below code works proper on my local system If i set port 587. But in server, It doesn't work. require('class.phpmailer.php'); require('class.smtp.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPSecure = "ssl"; $mail->SMTPAuth = true; $mail->Host = "smtp.gmail.com"; $mail->Username =

PHPMailer email sent successfully but not received (EC2)

社会主义新天地 提交于 2019-12-02 09:09:48
I am using PHPMailer on EC2. My account is not in a sandbox and Im sending from verified email. Im getting no errors from PHPMailer and thats my log 2017-03-31 06:24:52 Connection: opening to email-smtp.us-west-2.amazonaws.com:587, timeout=300, options=array ( ) 2017-03-31 06:24:52 Connection: opened 2017-03-31 06:24:53 SERVER -> CLIENT: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-2007935443 svKFRJ5M6s1rqbMTRdZu 2017-03-31 06:24:53 CLIENT -> SERVER: EHLO ***.domain 2017-03-31 06:24:53 SERVER -> CLIENT: 250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 250-STARTTLS 250-AUTH

Unable to connect to SMTP server

南楼画角 提交于 2019-12-02 08:31:17
I have a server with mail support, say example.com . I configured the server and added MX records via cpanel, so that I can receive and send mails via outlook.com with address myaddr@example.com . The MX records are got from domains.live.com . Now I need to send mail programmatically using PHP using SMTP. I tried PHPmailer using the following script. But it is showing the error Mailer Error: SMTP Connect() failed. (But I can send and receive emails via outlook.com using myaddr@example.com) $body = $_POST['message']; $to = "support@example.org"; $from = 'fromAddress@gmail.com'; $fName = 'first

PHPMailer saying could not connect to SMTP host

。_饼干妹妹 提交于 2019-12-02 07:54:19
问题 For the past 2 days I've been trying to get a PHP script to send an e-mail and it doesn't seem to work. First I've tried the normal php mail function, then PHPMailer and then Swiftmailer. I've tried to use both gmail's accounts and SMTP and the email account and SMTP of my internet provider, none worked. I tried to ping both SMTP servers and they worked fine and telnet replied correctly as well. On telnet smtp.gmail.com 587 it said 220 smtp.gmail.com ESMTP q125sm9630397wmd.19 - gsmtp. I've

How can I get the URL of each uploaded file and send through email?

时光怂恿深爱的人放手 提交于 2019-12-02 07:31:05
OVERVIEW: I have a form that includes 5 file upload fields. A php script processes the data and sends out 2 emails (one to the admin and a confirmation receipt to the user) AND appends the data to a .csv file on the server. QUESTION: How do I get the URL of the uploaded files in to a variable that I can use to populate the email and .csv file. Everything is working great except I need a link to each of the the uploaded files included in the emails and in the .csv file. I cannot seem to figure that part out after a couple days of trying. SIMPLIFIED HTML FORM: <HTML><head><title>MultiFile Upload

PHPMailer User Attachments

北城以北 提交于 2019-12-02 06:25:51
I'm attempting to create a form that sends an email with user populated data. So far everything send correctly however the attachment is never included in the email sent. Any help would be appreciated. HTML form asking user for data. "Mailerindex.html" <html> <head> <link rel ="stylesheet" type = "text/css" href = "style.css" /> </head> <div class="form-style-8"> <body> <form action= "PHPMailer.php" method ="POST" id="from" enctype="multipart/form-data"> <input type="text" name="fname" placeholder="Your Name"/> <input type="number" name="phoneNum" placeholder="Phone Number"/> <input type=

PHPMailer and function escapeshellcmd()

痴心易碎 提交于 2019-12-02 05:14:34
I use new version of PHPMailer. On the server, I get an error: Warning: escapeshellcmd() has been disabled for security reasons in /public_html/library/email/class.phpmailer.php on line 1442 Is there a function that could replace escapeshellcmd() ? No, escapeshellcmd() has some inherent problems which make it worth disabling for many, but you can work around it a different way: use SMTP to localhost instead . By default PHPMailer uses the PHP mail() function for sending, which calls a local sendmail binary via a shell (requiring the use of escapeshellcmd() ), which in turn opens a synchronous

Cannot redeclare PHPMailerAutoload()?

冷暖自知 提交于 2019-12-02 05:12:10
I start implementing a function of Emailing mass users, When I click on post the I get the following error. Cannot redeclare PHPMailerAutoload() (previously declared in C:\xampp\htdocs\bloodbank2\phpmailer\PHPMailerAutoload.php:24) in C:\xampp\htdocs\bloodbank2\phpmailer\PHPMailerAutoload.php on line 31 However the first user in the database is able to receive the Email and the rest dont. Here are my codes. 1st one is news.php, which allows person to post the news. <?php include 'core/init.php'; ?> <?php include 'includes/overall/oheader.php'; if (empty($_POST) === false){ $require_fields =

Error sending e-mail using Gmail SMTP

你离开我真会死。 提交于 2019-12-02 04:54:51
I'm trying to send e-mail using Gmail SMTP and PHPmailer . The problem is that i have this Error: SMTP -> ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: No such host is known. (0) SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host. Here's the code I am using: ?php require_once($_SERVER['DOCUMENT_ROOT'].'/FreeUni/Kiosk/class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); //GMAIL config $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the server