trying to get phpmail to send to an SMSgateway address

Started by rcane, January 30, 2022, 06:23:51 PM

Previous topic - Next topic

rcane

I've got a nice script working that sends out emails fairly well.
This script isn't work from inside SMF.

I'm having trouble getting it to agree to send successfully to my phone's SMS gateway address.

The process evaluates TRUE but they aren't sending/getting received.


SMF though WILL allow me to use an SMS gateway address for the account settings contact info.  So I was wondering what's different about SMS that allows SMS gateways but PHP in general won't?

Arantor

SMF adds the following headers on mailing:

  • From: name <[email protected]>
  • Return-Path: [email protected]
  • Date: Sunday, 30 Jan 2022 23:37:00 -0000
    (this should be in UTC ideally; if your server does not run in UTC life will be complicated)
  • X-Mailer: SMF

These are all separated with line-breaks where line-break is \n if on Linux and \r\n if on Windows.

SMF then does a lot more complicated stuff around chunking the message into MIME boundaries, transcoding it to 7-bit, and sending it with proper MIME boundary markers. You'll probably need to do the same.

This is not for the faint of heart. See the internals of sendmail() in Subs-Post.php starting from [tt]// Using mime, as it allows to send a plain unencoded alternative.[/tt]

rcane

Quote from: Arantor on January 30, 2022, 06:45:04 PMSMF adds the following headers on mailing:

  • From: name <[email protected]>
  • Return-Path: [email protected]
  • Date: Sunday, 30 Jan 2022 23:37:00 -0000
    (this should be in UTC ideally; if your server does not run in UTC life will be complicated)
  • X-Mailer: SMF

These are all separated with line-breaks where line-break is \n if on Linux and \r\n if on Windows.

SMF then does a lot more complicated stuff around chunking the message into MIME boundaries, transcoding it to 7-bit, and sending it with proper MIME boundary markers. You'll probably need to do the same.

This is not for the faint of heart. See the internals of sendmail() in Subs-Post.php starting from [tt]// Using mime, as it allows to send a plain unencoded alternative.[/tt]

wow that's a load info.  thanks.  I'll go take a look and start by changing my timezone back to UTC>

Arantor

Or you could do what SMF does and use gmdate() to let the server do the work.

Or you could do as I gently hinted in the previous topic to bootstrap SMF with SSI.php and let that do the work for you. This stuff is nightmarishly complicated (and what SMF does is a fraction of the full complexity really on offer)


Advertisement: