php - How to setup PHPMailer SMTP -


i'm trying send mail using php mailer, boring thing 1 email eas sent first time , have no idea i've done makes code fail.

error: smtp server error: authentication required

require("../mailer/class.phpmailer.php"); $mail = new phpmailer(); $mail->issmtp();  // telling class use smtp $mail->host     = "smtpout.secureserver.net"; // smtp server $mail->from     = "site email"; $mail->addaddress("useremail"); $mail->subject  = "first phpmailer message"; $mail->body     = "hi! \n\n first e-mail sent through phpmailer."; $mail->wordwrap = 50; if(!$mail->send()) {   echo 'message not sent.';   echo 'mailer error: ' . $mail->errorinfo; } else {   echo 'message has been sent.'; } 

i'm hosting godaddy.

thanks jake.

incase goes through again here put in code.

code

require("class.phpmailer.php"); $mail = new phpmailer(); $mail->issmtp();  // telling class use smtp $mail->host     = "smtpout.secureserver.net"; // smtp server $mail->username   = "email@domain"; $mail->password   = "pwd"; $mail->smtpauth   = true;        $mail->port       = 25; $mail->smtpdebug  = 2; /// guess reporting...   $mail->from     = "email@domain"; $mail->addaddress("recipient email"); $mail->subject  = "first phpmailer message"; $mail->body     = "hi! \n\n first e-mail sent through phpmailer."; $mail->wordwrap = 50; if(!$mail->send()) { echo 'message not sent.'; echo 'mailer error: ' . $mail->errorinfo; } else { echo 'message has been sent.'; } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -