Logic Machine Forum
E-mail without sender - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: E-mail without sender (/showthread.php?tid=5248)



E-mail without sender - dannynos - 15.02.2024

Hi,
LM 5 sends (from a script) E-mails with some data (attached files) correctly - using the mailattach function.
The only problem is, that the e-mails are sent "without" the sender identification in their header... So they arrive - are displayed according to the addresse's client as e-mails from nobody@nobody.nobody or with "no name sender" etc...

In common functions (function: mailattach.... local settings = {  ..... ) from is stated as string constant in format  (from = 'xyzy@smpt.cz',).
Smtp server/user/password entered in the identical way are "accepted" )
Any idea, what setting is missing/wrong...?

Thanks Daniel


RE: E-mail without sender - admin - 16.02.2024

The code in the example was incorrect. From header must be placed together with to and subject:
Code:
settings.source = smtp.message({
  headers = {
      to = table.concat(to, ', '),
      subject = subject,
      From = '<' .. tostring(settings.from) .. '>',
    },
...

If needed, you can add a name before < in the header so it's displayed together with the email address.


RE: E-mail without sender - dannynos - 18.02.2024

Thanks a lot.
Daniel