I am using the bluehost for my some sites hosting. For sending emails I used the SMTP service which is provided by bluehost.
Bluehost : Mailer Error: SMTP Error: Could not connect to SMTP host
I used the PHPmailer in my website for sending email. When I tried to use the bluehost SMTP I always got the following error message.
Mailer Error: SMTP Error: Could not connect to SMTP host.”
I solved this issue. I created the following function.
02 | include ( "class.phpmailer.php" ); |
04 | function mail_new( $fun_to , $fun_subject , $fun_body , $fun_header , $fun_from , $fun_cc ){ |
05 | $mail = new PHPMailer(); |
08 | $mail ->Host = "mail.eparinay.com" ; |
10 | $mail ->SMTPAuth = true; |
11 | $mail ->Username = "support@purabtech.in" ; |
12 | $mail ->Password = "YOURPSSSWORD" ; |
15 | $mail ->From = $fun_from ; |
16 | $mail ->FromName = "eparinay.com" ; |
17 | $mail ->AddAddress( $fun_to ); |
18 | $mail ->AddReplyTo( $fun_from , $fun_from ); |
21 | $mail ->AddAddress( $fun_cc ); |
28 | $mail ->Subject = $fun_subject ; |
29 | $mail ->Body = $fun_body ; |
34 | echo "Message could not be sent. <p>" ; |
35 | echo "Mailer Error: " . $mail ->ErrorInfo; |
Where you want to use the mail you just need to include the above script and call the “mail_new” function for sending email through bluehost.
Bluehost – Mailer Error- SMTP Error- Could not connect to SMTP host
i do the same as you, but it doesn’t work.
what u tried?