Fatal Error When Sending Email
Contents |
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is http://productforums.google.com/d/topic/gmail/7HESsfsif_U a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up What is causing a Fatal Error when sending email from a contact form via PHP and Swiftmailer? up vote 1 down vote favorite I am new to Swiftmailer and am trying to http://stackoverflow.com/questions/31672036/what-is-causing-a-fatal-error-when-sending-email-from-a-contact-form-via-php-and send mail via a HTML contact form on a localhost (XAMPP). After pressing the 'submit' button, the error reads: Fatal error: Class 'Swift_SmtpTransport' not found in /Applications/XAMPP/xamppfiles/htdocs/testsite/sendmessage.php on line 23 Line 23, 24, and 25 is this section: $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 587, 'tls') ->setUsername('foobar@googlemail.com') ->setPassword('GENERATED PASSWORD'); I am expecting the mail to send at this point, and show me a 'Mail Sent' message, along with the echoed lines within the PHP file, however while I'm seeing a "Mail Sent" confirmation I am also getting the error, and I do not receive an email. I have consulted the documentation here, and my code contained in 'sendmessage.php' appears to be correct: '; // Grab the post data $name = filter_var($_POST['Name'], FILTER_SANITIZE_STRING); $usermail = filter_var($_POST['Email'], FILTER_SANITIZE_EMAIL); $content = filter_var($_POST['Message'], FILTER_SANITIZE_STRING); // Construct the body of the email $data
Sign in Pricing Blog Support Search GitHub This repository Watch 653 Star 7,247 Fork 4,158 PHPMailer/PHPMailer Code Issues 51 Pull requests 10 Projects 0 Wiki Pulse Graphs New issue https://github.com/PHPMailer/PHPMailer/issues/273 emailing list of names and fatal error if email is bad/wrong #273 Closed skashmeri opened this Issue Sep 10, 2014 · 22 comments Projects None yet Labels None yet Milestone http://answers.microsoft.com/en-us/windows/forum/windows_xp-networking/how-do-i-resolve-my-email-have-permanent-fatal/b5840e4b-1959-4502-95bc-952c70fe5eee No milestone Assignees No one assigned 2 participants skashmeri commented Sep 10, 2014 Hello, Just wondering if anyone can help me I am using smtp to send to groups of email addresses email error with the latest greatest version of phpmailer. My only problem is a bad email address stops the entire send process at that point. so if there is a bad email in the second group for instance it stops and doesnt just keep sending... Here is the error: 10-Sep-2014 03:33:39 UTC] PHP Fatal error: Uncaught exception 'phpmailerException' with message 'SMTP Error: The following recipients failed: joe.somebody@bmo.jp' fatal error when in /.../.../.../public/PHPMailer-master/class.phpmailer.php:1243 Is there any way to suppress this error so it just continues to send? I can log the bad email and remove but I still cant 'continue' the send. Thank you kindly. PHPMailer member Synchro commented Sep 10, 2014 Well how about you catch the exception and continue? That's what exception handling is for! You also don't say how you're doing the sending to multiple addresses - lots of recipients in $To? Or are you looping over a list and sending individually? skashmeri commented Sep 10, 2014 Sorry yup I am doing that but on the list, its looping through an array getting the list by 75s and then sending... so loop addBCC add email stuff foreach ($bccz as $bcc) { $i++; echo '
GROUP: '.$i.'
'; while (list($key, $value) = each($bcc)) { //echo $key . ':' . $value['email'] . ''; $fullname = $value['cFname'] . ' ' . $value['cLname']; if ($fullname == ' '){ echo $key . ': ' . '$mail->addBCC(' . $value['email'] . ');
'; $mail->AddBcc($value['email']); }else{ echo $key . ': ' . '$mail->addBCC(' . $value['email'] .', ' . $fullname . ');
'; $mail->AddBcc($value['email'], $fullname); } }//end while loop! $mail->addAddress('validemail'
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 14 Oct 2016 04:58:14 GMT by s_ac4 (squid/3.5.20)