Able to send mail from localhost but the same does not work with infinityfree

WebsiteURl: sabzCorp.in

I am using Gmail SMTP to send mail from my website where i am using PhpMailer library for same.
I am able to send mails from my localhost when run locally but same when hosted to infinityfree , its not working & there is no error or exception occuring

Can someone please look into this, why its happening like this or do i need to do any additional setting in this regard

Thanks
Sabir

typo, in heading , it not working

WB !

Please enable debugging in phpmailer

5 Likes

Doesn’t looks an issue with my php code with phpmailer as its working on my local machine.

turn on debug mode for phpmailer and see what phpmailer will tell you

3 Likes

tried adding this, but no luck, no error

$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->SMTPDebug = 2; //Alternative to above constant
$mail->isSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP port
$mail->Host = “mail.yourhost.com”; // SMTP server
$mail->Username = “[email protected]”; // SMTP account username
$mail->Password = “your password”; // SMTP account password

I have modified above code as per my data but still blank

Thanks OxyDac, enabled all debugging mode and caught with below error:

[SMTP ERROR: Password command failed SMTP connect() failed]

Able to reolve this by unlocking captcha

Thanks

3 Likes

Port 25 is blocked on our servers (as that would allow you to send email directly to other mail providers without using a proper sending server). Please use different ports and enable encryption. You can use port 587 with tls encryption or port 465 with ssl encryption.

I assume localhost is whitlisted in google reCAPTCHA for easy testing
but for another environment it is necessary to add domains (hosts) as whitelisted
in the configuration of the reCAPTCHA API

4 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.