0

error:
Mail error SMTP Error: Could not connect to SMTP host.

i think its bc of mail->port=465. but iam not sure.

                    $mail = new PHPMailer();
                    $mail->IsSMTP(); 
                    $mail->SMTPAuth   = true;                  // enable SMTP authentication
                    $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
                    $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
                    $mail->Port       = 465;                   // set the SMTP port for the GMAIL server
                    $mail->Username = "a@gmail.com";    //yourname@yourdomain
                    $mail->Password = "fe";           //password

                    //to
                    $mail->AddAddress($email_p, $user_name_p); //to:    
                    //subject
                    $mail->Subject = "Forgot password";
                    //html body
                    $mail->IsHTML(true);
                    $mail->Body = "HEllo $first_name_db,<br/>Your password are $password_db";
                    //from
                    $mail->From = "a@gmail.com";
                    $mail->FromName = "a";
                    $mail->wordWrap = 50;

                    //send
                    if(!$mail->send())
                    {
                        $forgot_error .= "Mail error ".$mail->ErrorInfo;
                    }

also what is wordwrap= 50 means?

Edited by hwoarang69

2
Contributors
1
Reply
12
Views
4 Years
Discussion Span
Last Post by jstfsklh211
0

where is your site hosted? its blocked from some shared hosting providers (godaddy)

word wrap limits your line length wraps to next live after 50 words

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.