OK, I did a comparison between the SMTP commands that the B4A NET lib sends (where the MailFrom does not work) and what two other apps send (where MailFrom works).
The B4A NET lib has this relevant sequence of events (MailFrom does NOT work):
rsp: 235 Authentication successful
Authenticated as
send@mydomain.com
cmd: MAIL FROM:<sales@mydomain.com>
rsp: 250 OK <sales@mydomain.com> Sender ok
My default Samsung Email app on my S4 has this sequence of events in the log (MailFrom works):
rsp: 235 Authentication successful
Authenticated as
send@mydomain.com.com
RSET
250 OK
cmd: MAIL FROM: <sales@mydomain.com>
rsp: 250 OK <sales@mydomain.com> Sender ok
You will notice that my S4 client sends the two lines in bold that the B4A NET lib doesn't.
These are the commands that my outlook 2003 sends (MailFrom works):
rsp: 235 Authentication successful
Authenticated as
send@mydomain.com
cmd: MAIL FROM: <sales@mydomain.com>
rsp: 250 OK <sales@mydomain.com> Sender ok
At first glace this looks identical to what the B4A NET lib outputs, even to the extent that it also does not send the RSET command that the S4 email app does.
But there is one slight difference common between Outlook and my S4 app and what the B4A NET lib does
NOT do...
Outlook and S4 will
insert a space between "MAIL FROM:" and "<sales@mydomain.com>", whereas the B4A lib does not.
I know that adding a space should not make a difference. But, I did spend a lot of time analyzing this as you requested, and that is the only difference I can see, so I think it's at least worth trying.
However, I can not make the modification to the NET lib to test to see if adding a space will fix the problem, so it would be greatly appreciate, Erel, if you could send me a test NET lib that will insert a space between the
MAIL FROM: and the
<requested from address> so that I can see if this fixes my issue.