I have some php code which submits an email to the user (and CC’s me) using php’s mail() function. This was inconsistent in getting to the user’s inbox, unsurprisingly because it was sometimes being marked as spam, and other times not even getting as far as the user’s spam box!
The emails are handled by o365. I did try specifying in php to send the email via smtp, but I just couldnt get it working. That was about 6 months ago, so cant remember what I tried.
I really need to get this sending via smtp but I need a bit of hand-holding. I have the mailbox’s username/password etc… so its just a case of getting the ‘smtp bit’ working.
I suppose I could use an SMTP service like SendGrid, but Id rather not if I can help it. (because I think that the contents of the email needs to reside on SendGrids platform, yet some of the email’s content is dynamically generated depending on what the user has entered on the form, so I dont know how I could get that working with SendGrid).
If I can just get a ''hello world" example of sending email via smtp using my mailbox settings, then I can do the rest.