How to send a mail in php with html table,I received an smtp port 25 error msg | Sololearn: Learn to code for FREE!

+1

How to send a mail in php with html table,I received an smtp port 25 error msg

php

4/16/2018 4:59:06 PM

Hirishi

5 Answers

New Answer

+1

"You need to be running a mail server" https://stackoverflow.com/questions/4532486/failed-to-connect-to-mailserver-at-localhost-port-25?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

+1

Note, if you upload to a hosting service, it will probably work.

+1

<?php $to = '[email protected]'; $subject = 'Marriage Proposal'; $message = 'Hi Jane, will you marry me?'; $from = '[email protected]'; // Sending email if(mail($to, $subject, $message)){ echo 'Your mail has been sent successfully.'; } else{ echo 'Unable to send email. Please try again.'; } ?>

0

I actually tried this,but the same error occurs....

0

You'll need to show your code then. Also check PHP logs. Again, this is why frameworks are better than coding this stuff yourself