ChaosKnight Posted May 10, 2010 Share Posted May 10, 2010 Hi, I'm busy implementing PHPMailer in a project, but after hours of hard work, I finally gave up... I got a sample script on one of the php threads here on phpfreaks, but when I try to send the e-mail from the script, the entire contact form include just turns blank, and none of the code gets executed... In the contact include at the top I have the code that gets executed when the sebmit button is pressed, and at the bottom is the HTML form, so I made the form action a blank (action="", I don't know if this is where the phpmailer experiences a problem?). But all the php code is executed, the only problem is the phpmailer code... require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "$domainname"; $mail->SMTPAuth = true; $mail->Username = "$username"; $mail->Password = "$password"; $mail->From = "$from"; $mail->FromName = "$fromname"; $mail->AddAddress($to); $mail->AddReplyTo($reply); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = "$subject"; $mail->Body = "$body"; if(!$mail->Send()) { echo "<h3>The message could not be sent...</h3>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; }else{ echo "<h3>The message was sent successfully...</h3>"; } Not even the error info is return, it just return a complete blank... Any thoughts?? Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted May 10, 2010 Share Posted May 10, 2010 put this after <?php towards the top ini_set('display_errors', 1); Quote Link to comment Share on other sites More sharing options...
ChaosKnight Posted May 14, 2010 Author Share Posted May 14, 2010 It threw out the following error messages: Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in f:\wwwroot\domain\PHPMailer\class.phpmailer.php on line 53 Fatal error: Cannot instantiate non-existent class: phpmailer in f:\wwwroot\domain\contact.php on line 20 Line 20 in my code is: $mail = new PHPMailer(); So the problem is in the PHPMailer source code? I'm using PHPMailer v5.1 Here is PHPMailer v5.1 line 53: x[$h2].$hex[$h1]; } if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay $newline = ''; // check if newline first character will be point or not if ( $dec == 46 ) { $c = '=2E'; } } $newline .= $c; } // end of for $output .= $newline.$eol; } // end of while return $output; } Any ideas? Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted May 15, 2010 Share Posted May 15, 2010 The line you quoted is half of line 1663 of the class.phpmailer.php file. Somehow you are missing most of the file. Re download it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.