Mailer Error Could Not Instantiate Mail Function Phpmailer
Contents |
the code: From = "deca@platform.com"; $mail->FromName = "DECA"; $mail->AddAddress("popendot@yahoo.com","Dhruv G"); $mail->AddReplyTo("info@platform.com","Information"); $mail->WordWrap = 50; // set word wrap $mail->IsHTML(true); // could not instantiate mail function wordpress send as HTML $mail->Subject = "Test"; $mail->Body = "Body Testing..."; $mail->AltBody =
Codeigniter Could Not Instantiate Mail Function
"This is the text-only body"; if(!$mail->Send()) { echo "Message was not sent
"; echo "Mailer Error: " . $mail->ErrorInfo; phpmailer could not instantiate mail function windows exit; } echo "Message has been sent"; ?> cranial_bore 2006-04-17 06:34:38 UTC #2 IMO experience this is caused my errenous configuration of php.ini Are you on a windows server? Have you could not instantiate mail function phpmailer localhost setup your php.ini to send email? You could also try a test email with the standard mail function to see if that works: if(mail('test@domain.com', 'Test email', 'Test email with standard mail() function')) { echo 'Mail sent'; } else echo 'Mail sending failed'; sarahG 2006-04-17 12:44:54 UTC #3 I presume you have the sendmail set up. For the version I have running on
Wordpress Phpmailer Could Not Instantiate Mail Function
a Linux server I also have this line $mail->IsMAIL(); whereas if using SMTP you would have $mail->IsSMTP(); put either one of these lines in after instantiating the class popendot 2006-04-17 16:14:58 UTC #4 i added the line..it still doesnt worki'm thinking it's probably my php.ini file, here is the only change i've made to it SINCE i've installed phpmailer: (NOTE: I'M TESTING MY LOCAL FILES ON APACHE) [B][mail function]; For Win32 only.SMTP = localhostsmtp_port = 25 ; For Win32 only.;sendmail_from = root@localhost.com[/B] sarahG 2006-04-17 19:52:31 UTC #5 I presume when you say Local Files on Apache you mean locally on your own machine and not on a hosted server? If so unless you have an SMTP server running then I can't see that working. Change the SMTP from localhost to your SMTP address of your ISP. Also if you're using SMTP email then you need the second line I mentioned earlier, the IsSMTP() line, plus you also need to include the SMTP class in the same directory as your phpmailer class. popendot 2006-04-17 23:20:15 UTC #6 ok, so i am not using SMTP any more
Sign in Pricing Blog Support Search GitHub This repository Watch 656 Star 7,284 Fork 4,174 PHPMailer/PHPMailer Code Issues 49 Pull requests 11 Projects 0 Wiki Pulse Graphs New issue Mailer Error: Could not instantiate mail function. #648 could not instantiate mail function joomla Open adrianrios25 opened this Issue Mar 7, 2016 · 7 comments Projects None yet could not instantiate mail function localhost Labels None yet Milestone No milestone Assignees No one assigned 3 participants adrianrios25 commented Mar 7, 2016 Got this error
Codeigniter Phpmailer Could Not Instantiate Mail Function
when sending big file size attachment like 16MB or bigger. I already set the post_max_size and max_execution_time to higher value. I'm using smtp connection to our own web server (not using google or yahoo mail). Hope https://www.sitepoint.com/community/t/phpmailer-could-not-instantiate-mail-function/2524 someone can help me with this. PHPMailer member Synchro commented Mar 7, 2016 Check memory_limit too - PHPMailer uses quite a lot when procesing large attachments, and email is really not a good way of transferring large files. Does your script work correctly without the attachment? elminson commented Mar 8, 2016 You don't say if you restart your service (apache or gnix) to this change take effect. this change need to be done in https://github.com/PHPMailer/PHPMailer/issues/648 the /etc/php.ini some web servers not support set this parameter directly in the php script. adrianrios25 commented Mar 8, 2016 working great without and with small attachment, I just have problem with big files as mentioned, @elminson I created a php.ini file and checked the phpinfo() and changes are applied. I will try to increase memory_limit adrianrios25 commented Mar 8, 2016 okay, It turns out that I also have problem using SMTP, this error could be related right? What I mean is that I should be using smtp to send big file attachment? I tried to telnet my server and port and it connected with no error. I also tried using $mail->Host = gethostbyname(); This is the error: 2016-03-08 05:33:29 Connection: opening to 212.227.15.167:587, t=10, opt=array ( ) 2016-03-08 05:33:39 SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed. adrianrios25 commented Apr 13, 2016 2016-04-13 04:06:51 SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed. Still getting that error despite following the example for gmail and I can also ping and telnet host require '../phpmailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->IsHTML(true); $mail->IsSMTP(); // Use SMTP $mail->SMTPDebug = 2; // 2 to enable SMTP debug information $mail->Host = "smtp.gmail.com"; // Sets SMTP server $mail->Port = 587; // set the
Sign in Pricing Blog Support Search GitHub This repository Watch 656 Star 7,284 Fork 4,174 PHPMailer/PHPMailer Code Issues 49 Pull requests 11 Projects 0 Wiki Pulse Graphs New issue Keep getting https://github.com/PHPMailer/PHPMailer/issues/670 error "Message could not be sent.Mailer Error: Could not instantiate mail function." #670 Open conaris opened this Issue Mar 26, 2016 · 16 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants conaris commented Mar 26, 2016 Hello, I am trying my suggest.php file so it can retrieve user input from an html5 form and then could not send the details to a personal email address. I keep getting this error ""Message could not be sent.Mailer Error: Could not instantiate mail function." Also do i need IsSMTP for personal emails accounts? ValidateAddress($email)) { echo "Invalid Email Address"; exit; } //$mail->IsSMTP(); $email_body = ""; $email_body .= "Name: " . $name . "
"; $email_body .= "Email: " . $email . "
"; $email_body .= "Customer Question: " . $details . "
"; $mail->setFrom($email, $name); $mail->addAddress('example@example.com', 'Author'); // Add a recipient $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Customer Question ' . $name; $mail->Body = $email_body; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } header("location:suggest.php?status=thanks"); } ?> PHPMailer member Synchro commented Mar 26, 2016 This is a bit of a mess. You really should base your code on the examples provided with PHPMailer. The only file you need to load is the autoloader - it deals with loading the other files, which is why it's called an autoloader. This is covered in the readme. Don't use the submitter's address as the From address as it is forging, and will cause bounces. Put your own address in From and put their address in reply-to. You need to