Problem sending e-mails with body content

2,860 views
Skip to first unread message

David Pennington

unread,
Aug 12, 2022, 11:26:35 AM8/12/22
to VAST Community Forum
Hi everyone.
We are trying to use the built in Email support in V11.0.1.

I have tried the example messages and can successfully send an e-mail from one of our account domains to that in another domain of ours. However, only the test works. None of your tests includes any body except for a single line. As long as I add to that line, the e-mail goes correctly. If I try and add any more body text but with line feeds in I get an error coming back from all of our target mail addresses. As an example, when I send an e-mail to my gmail account - lhdav...@gmail.com, I get the following response.

___________________
 lhdav...@gmail.com
   host gmail-smtp-in.l.google.com [64.233.167.26]
   SMTP error from remote mail server after pipelined end of data:
   550-5.7.1 [94.126.40.73] Messages missing a valid messageId header are not
   550 5.7.1 accepted. p11-20020a5d68cb000000b0021f0c838e0fsi1314943wrw.212 - gsmtp
Reporting-MTA: dns; mail.lcn.com

Action: failed
Final-Recipient: rfc822;lhdav...@gmail.com
Status: 5.0.0
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [94.126.40.73] Messages missing a valid messageId header are not
550 5.7.1 accepted. p11-20020a5d68cb000000b0021f0c838e0fsi1314943wrw.212 - gsmtp

Subject: Old Bill's Switch List - Forgotton Password


Hello from Marblecake Support

Thank you for your password reset request.  
____________________________

If I remove the line "Thank you for your password reset request.  " the mail goes through without issue. Can anyone explain how to sort this out please?
David

Joachim Tuchel

unread,
Aug 13, 2022, 5:46:58 AM8/13/22
to VAST Community Forum
HI David,

I don't think these things are related. The message you cite means that you didn't add a Message-id header. Just try adding one, using a UUID or some simple alphanumeric String. I wonder why you get this message, because an MTA usually just adds one if one's missing. As little as I know about mails. the first hop needs to make sute there is one or your message cannot start its journey through the mailiverse.

I have no idea why removing that second line changes the behaviour, because you still don't send a message-id. One thing I'd ask you to check if you really have two empty lines after the headers. Could you try sending the same message with only one empty line between headers and body?

Cna you share your source code? What protocol are you using to send the message? How did you assemble it before sending it?

Joachim

Joachim Tuchel

unread,
Aug 13, 2022, 5:47:55 AM8/13/22
to VAST Community Forum
okay, looking at your message, it is clear you used SMTP. Stupid me ;-)

David Pennington

unread,
Aug 13, 2022, 7:22:31 AM8/13/22
to VAST Community Forum
Hi Joachim.

I use the standard text that comes with the sendMail example but the example only sends a single line, which works so my single line also works. I can't see how adding more lines at that time changes anything as the headers are clearly there and accepted. I can only think that I must try and make the message an attachment but I don't think that this is explained in the examples. Unfortunately, the examples are very good at the initial sending but no good for anything else that I can see. Maybe I am just stupid in my old age. 

Louis LaBrunda

unread,
Aug 13, 2022, 2:43:43 PM8/13/22
to VAST Community Forum
Hi David, Everybody,

I have attached a fileout and .dat of an application I made to make sending email easier.  Below is some code that if run in a workspace (with the app loaded) will send an email.  You will need to replace many of the strings within quotes with your own data to get it to work with your SMTP host.  You may use the app if you like or look at it to see where you may be going wrong.  Off the top of my head, I'm not sure why what you are doing doesn't work.  Good luck.

Lou

    | subject address smtpEMailInfo eMail body |

    subject := 'This is the subject.'.
    smtpEMailInfo := KscSmtpEMailInfo new.
    smtpEMailInfo
        host: 'smtpsl://smtp.comcast.net';            "This needs to be your SMTP host."
        userId: 'A userid that can use your host';
        password: 'That users password';
        fromEMailUserName: 'The name of the sender';
        fromEMailAddress: 'the email address of the sender'.

    address := KscEMailInfo name: 'name of person to get the email' address: 'their email address'.

    eMail := smtpEMailInfo eMailMessage.
    eMail to: address address; subject: subject.
    body := WriteStream on: (String new: 1000).
    body
        nextPutAll: 'Hi Lou,'; cr; cr; nextPutAll: 'One line of the body.'; cr; cr;
        nextPutAll: 'More lines of the body'.

    eMail body: body contents.
    smtpEMailInfo addOutGoingEMail: eMail.

KscEMailApp.dat
KscEMailApp.app

David Pennington

unread,
Aug 14, 2022, 11:42:05 AM8/14/22
to VAST Community Forum
Thanks Lou. That seems to work. I have had to comment out all calls to self logDebug: as ~I don't know how to set that up.

Have you tried putting html in the body. I would like to put a name to a link say - marblecake.net - and have it become a link to http://www.marblecake.net. Any ideas? 

David
(We had this all sorted back in SocketSet days - memories!)

Louis LaBrunda

unread,
Aug 14, 2022, 2:04:29 PM8/14/22
to VAST Community Forum
Hi David,

I think it should work without commenting out the log stuff.  If you make a class to do logging you tell the instance of KscEMailProcessor about it with:

logObject: anObject for: aKscSmtpEMailInfo
    "A lookup table of logObjects, used for logging, they accepts #log: and #logDebug: with a string to log."
...

Your logging class needs to accept #log: and #logDebug:.

But again I think everything is smart enough to know that no log class has been defined.

As for HTML in the body I don't know why it wouldn't work.  I think the only problem is with hex bytes like non normal characters and null stuff.  That is why they have all the mime (and such) encoding stuff.

Lou

Louis LaBrunda

unread,
Aug 15, 2022, 10:00:37 AM8/15/22
to VAST Community Forum
Hi All,

I uploaded my KscEMailApp to VAST Goodies.  The app makes it easier to send emails.

Some email can take a while to send, so the app makes it easy to stack them up and send them in the background.

It supports logging via your own log class.  Your log class can log what the email app is doing however it likes.  Two kinds of log messages are sent.  Regular messages that are expected to be sent but don't have to be and debug messages that are expected to be sent if your log class has debug logging turned on.  How your log class handles that is up to you.

It supports sending SMS text messages to smart phones via sending an email to an email address defined for the phone number by its carrier.  If you are not sure which carrier your recipient has, you can look it up at:


I accidently uploaded a bad config map to VAST Goodies so be sure to use the latest map.  Does anyone know how I can get the bad map off VAST Goodies?

Have fun and if there are any questions, just ask.

Lou
.
Reply all
Reply to author
Forward
0 new messages