Sending email via smtp - set error message if it doesn't send?
Hi Ray, I've been asked to modify our web contact forms for one client to use their own smtp servers. I've set up a test page using the smtp details they gave me and it's working fine. I redirect to pagename?sent=true on submit and display a success message in the following format:
<?php if(isset($_GET['sent']) && $_GET['sent'] == "true") { ?>
Success message
<?php } ?>
However, I would also like to display an error message if the email isn't sent successfully, for example if the email didn't reach our client's mail server for whatever reason or bounced. Not sure how I would do this though - can you advise if it's possible when presumably the error would be generated by the receiving server?