ttocskcaj Posted August 21, 2010 Share Posted August 21, 2010 Hi I'm trying to get my script to send emails using the PEAR mail function but I keep getting and error code. include('Mail.php'); $from = "My email"; $subject = "Heoli Verification"; $body = "Hi,\nClick this link to activate your account\n".$validate_link; $host = "ssl://smtp.gmail.com"; $port = '465'; $username = "my email"; $password = "my password"; $headers = array ( 'From' => $from, 'To' => $email, 'Subject' => $subject); $smtp = Mail::factory('smtp',array ( 'host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { die("<p>" . $mail->getMessage() . "</p>"); } else Rest of code... Error message: Failed to add recipient: @localhost [sMTP: Invalid response code received from server (code: 555, response: 5.5.2 Syntax error. v13sm4079748wfv.17)] php 5.3.1 with XAMPP Quote Link to comment https://forums.phpfreaks.com/topic/211337-pear-mail-with-gmail-smtp/ 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.