SMTP Autentication

Oops, I made a silly mistake.

Here is the update I needed applied (my bad)

echo '{"MusePHPFormResponse": { "success": false,"error": "Failed to send email ' . $mail->ErrorInfo . '"}}';  

:frowning:

When running your form, I’m using Chrome (because I like their dev tools). So before I submit the form, I hit F12 to get the Dev Tools opened, go to the Network Tab, then submit the form and you’ll see a request for form-u203.php appear in the Network section. Click on it. Click on Preview and you’ll see the output from your form submission

Done. Any luck?

Yep, it returned “MusePHPFormResponse: {success:false, error:Failed to send email SMTP connect() failed.}”

So it thinks your username and password is incorrect. Be sure those are set to what you use to login to view your emails.

I added the smtp details my host gave me. I’ll check them

Just checked and the smtp mail details are correct. Not sure what to do now?

There are other scripts associated with the form, will it help if i put that code on here too?

Okay, try it after commenting out the following line:

$mail->SMTPSecure = 'tls';

So that line should look like:

//$mail->SMTPSecure = 'tls';

That worked!

Why did commenting that out work?

TLS would alter how the data gets sent, if TLS isn’t supported (and potentially the port it uses), then it would fail. It seems your host doesn’t use TLS. I only figured that out after watching their video on setting up your email in Thunderbird and they didn’t check the TLS encryption option :slight_smile:

FYI: You may want to alter your error message to be

echo '{"MusePHPFormResponse": { "success": false,"error": "Failed to send email"}}'; 

That way you don’t expose anything unnecessarily.

Fantastic mate, I am aware of taking up a lot of your time on this and I really do appreciate it . Thank you very much :slight_smile:

Next problem is will Muse overwrite the script when I upload the site again after making changes lol
I had better copy that code :wink:

Again many many thanks

John

I have no idea if Muse will overwrite it, so please make a backup of it, or bookmark this page so you can get back what you may lose. I unfortunately have zero experience with Muse so I can’t tell you what it may do. :frowning:

I’m glad I could get you up and running though! :smiley:

It might be a good idea to tell the Muse authors that their script needs amending to work on hosting where SMTP authentication is required. That way they might actually apply the necessary changes in the next version so that you don’t have to reapply them yourself.

Hey

I have been searching for a way to do this for half a month now but your answer is the only one that helped removed the “PHP not configured properly” error. However, my website still can’t send emails. I tried commenting out tls, everything. You can reproduce the problem by entering any email address at http://subscribershop.com

Regards
Anmol

Hi @4nm0l17,

You have the same issue that @jstead recently had.

Start reading with this post

And let me know if you need additional help.

Hi; i have the same problem. Tried to do what you told to jstead. But php file is kind of different from jstead’s.

Could you help me about the codes?

Yes. Post it as a new topic and mention me.

Thank you. I post already

I have a similar problem, to start a new topic and mention you, do I just write your name in the body text of my question? Thank you!!

Yup, just use @cpradio and it will call me out :slight_smile:

A post was split to a new topic: SMTP Authentication problem