1. John Vanleeuwe
  2. PowerBuilder
  3. Monday, 14 October 2019 08:46 AM UTC

Hi all,

i just started implementing the topwiz smtp object solution into my code.

 

I am connecting to o365 without any problem, sending works also.

only my mail is being send like this , the whole content of the mail is viewable in the body of the mail... The attachment is not there, yet the base6 encoded string appeaers in the body as well as all the other settings of the smtp object (from , to , subject )

 

i think i must be missing a parameter somehwere, anyone have any idea ?

i am using the gn_smtp.SendTlsMail() function on PB2017 R3.

 

TIA

John

 

 

From:

To:

Subject: =?utf-8?B?Vk9MR0JSSUVGSkUg?=

 =?utf-8?B?LyA=?=

 =?utf-8?B?TEFJU1NFWiA=?=

 =?utf-8?B?U1VJVlJFIA==?=

 =?utf-8?B?OiA=?=

 =?utf-8?B?MTEwMDg5LUZPUlRZLVQxLSA=?=

 =?utf-8?B?LSA=?=

 =?utf-8?B?MTlCRTEwMTAwMFQ3ODk1NTgyIA==?=

 =?utf-8?B?LSA=?=

 =?utf-8?B?MTlCRTQyNjI3OTY2MzA1NTAwMg==?=

Date: Mon, 14 Oct 2019 10:27:14 +0200

Message-ID: <6C479C33$EE5C$11E9$4494$2407650@sotiauxint.eu>

MIME-Version: 1.0

Content-Type: multipart/mixed;

 boundary="000_6C479C34-EE5C-11E9-4494-24070B800000"

 

This is a multi-part message in MIME format.

--000_6C479C34-EE5C-11E9-4494-24070B800000

Content-Type: text/plain;

                charset="iso-8859-1";format=flowed

X-Mailer: TopWiz PowerBuilder SMTP Object

Content-Transfer-Encoding: 7bit

 

document

 

--000_6C479C34-EE5C-11E9-4494-24070B800000

Content-Type: application/pdf;

                name="FL-19BE101000T7895582.pdf"

Content-Transfer-Encoding: base64

Content-Disposition: attachment;

                filename="FL-19BE101000T7895582.pdf"

 

JVBERi0xLjUKJeTjz9IKNiAwIG9iago8PC9MZW5ndGggNSAwIFIvRmlsdGVyL0Zs

YXRlRGVjb2RlPj4Kc3RyZWFtCnicxVldb924ESXgt7sBmm5unCbxAnpINnHblflN

Cu3TwrE3QVDHjp14EfepH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14diF4B

 

 

 

Michael Kramer Accepted Answer Pending Moderation
  1. Tuesday, 15 October 2019 12:07 PM UTC
  2. PowerBuilder
  3. # 1

Hoi John, a shot from the hip: Do you run your app in an environment where regional settings has comma as decimal separator?

Such difference potentially invalidates the structure of the "package" so everything is thrown into the body.

Also, I see start of text references UTF-8: Do you have the right BOM sequence at start of text?

HTH /Michael

Comment
  1. John Vanleeuwe
  2. Tuesday, 15 October 2019 12:13 PM UTC
Thanks Michael. We do have comma as the decimal separator , we always did , so not sure why the new lib has problems with this , but the old didn't (?)



I will try to test this , but not easy to have customers changing regional settings on their server :)



TIA

John
  1. Helpful
  1. Michael Kramer
  2. Tuesday, 15 October 2019 13:37 PM UTC
I agree. But if that is the culprit, then we know what caused the malfunction. Without cause it is hard to develop a fix.

We should expect regional settings on any machine are beyond our control. However, it may be something else that triggers O365 to misbehave. Decimal comma and BOM prefix are just roots of many evils.
  1. Helpful
There are no comments made yet.
John Vanleeuwe Accepted Answer Pending Moderation
  1. Tuesday, 15 October 2019 11:49 AM UTC
  2. PowerBuilder
  3. # 2

Anyone got this working ?  We need an urgent solution :(

 

Any more idea's ? 

 

I have already tried limiting the subject line , with or without attachment , it still puts the whole email header into the subject of the mail.

 

TIA

John

Comment
  1. Miguel Leeuwe
  2. Wednesday, 16 October 2019 11:33 AM UTC
Myself I'm in the UK.
  1. Helpful
  1. John Vanleeuwe
  2. Wednesday, 16 October 2019 11:39 AM UTC
Miguel , problem has been found and fixed.



All it took was one CRLF too much in the of_sendsecmail_send



I must have added it while looking on the net for solutions. Took the extra CRLF off , and it works like a charm.



I do apologise for this :( Roland , sorry !!





Greets

John
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 16 October 2019 13:05 PM UTC
That's great news! I just went back in to tell you I've uploaded a working version of Roland's sample with the settings that work for me, hahah!

Anyway, has been good for me to find out which settings are working for us.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 14 October 2019 17:49 PM UTC
  2. PowerBuilder
  3. # 3

The seemingly random characters at the end is the attachment converted to Base64 text. That is how email attachments are sent.

Run it in debug mode with a stop in the of_databody function. The string returned at the end should end with a period separated by CRLF characters.

 

Comment
  1. John Vanleeuwe
  2. Monday, 14 October 2019 17:53 PM UTC
i know Roland , i only cut a part of the base64 part into my post.



  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 14 October 2019 13:45 PM UTC
  2. PowerBuilder
  3. # 4

Another idea, try taking the dashes out of the subject line and see if that helps.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 14 October 2019 13:43 PM UTC
  2. PowerBuilder
  3. # 5

This is a strange issue, not sure what would cause it. There is definitely a bug in the code that breaks out long subject lines.

What happens if there is no attachment?

 

You could try using this instead:

http://www.topwizprogramming.com/pbnismtp.html

 

Comment
  1. John Vanleeuwe
  2. Monday, 14 October 2019 15:59 PM UTC
Same without attachment.



All the content is put as body of the email , so strange.



It seems like the email header is not having the correct content type ... Not sure how to fix this, without resuming to pbnismtp solution...



  1. Helpful
There are no comments made yet.
John Vanleeuwe Accepted Answer Pending Moderation
  1. Monday, 14 October 2019 13:24 PM UTC
  2. PowerBuilder
  3. # 6

Hi Roland,

thanks for your suggestion/reply !

its higly appreciated!

 

ok the subject was larger than 80 characters. I respected the 80 limit , but still the same

 

From: <>

To: "support" <>

Subject: NCTS FL : 110089-FORTY-T1- - 19BE101000T7895582 - 19BE426279663055002

Date: Mon, 14 Oct 2019 15:22:17 +0200

Message-ID: <A48462A5$EE85$11E9$C406$5307000@blanked>

MIME-Version: 1.0

Content-Type: multipart/mixed;

 boundary="000_A48462A6-EE85-11E9-C406-53070B800000"

 

This is a multi-part message in MIME format.

--000_A48462A6-EE85-11E9-C406-53070B800000

Content-Type: text/plain;

                charset="iso-8859-1";format=flowed

X-Mailer: TopWiz PowerBuilder SMTP Object

Content-Transfer-Encoding: 7bit

 

document

 

--000_A48462A6-EE85-11E9-C406-53070B800000

Content-Type: application/pdf;

                name="FL-19BE101000T7895582.pdf"

Content-Transfer-Encoding: base64

Content-Disposition: attachment;

                filename="FL-19BE101000T7895582.pdf"

 

JVBERi0xLjUKJeTjz9IKNiAwIG9iago8PC9MZW5ndGggNSAwIFIvRmlsdGVyL0Zs

YXRlRGVjb2RlPj4Kc3RyZWFtCnicxVldb9y4FSXgN2+AZtfjZJN4AT0kG7vtyvwm

hfZp4dibIKhjx05cxH1qtwWKpHDz0h/RH9C/23MvSUkzI8ka73aLgS1eSiLPvSTP

/ZCsJH7nJ9uqot/nv23LOujqX5BfbUu+iT5laucr43wtbeW0qyGopja6+vzj9ttt

HXUdbRVkrG2sNB7DHWNX7/sQ6P1yX5Ow9L7Vte7djjHdVhhKxyoYQzeUVnzppjcA

BHghuFrG6tNAT5YJQPDVR5oS7yuMAsjG8zurPcaE2toi0zutiVIDRpP0BmzlafRG

Ab1D21fKZvDfZxvys2xXWUWr6kbznP/cVrWUykR+qLS1CvRA42oVG1v9+VO3EN9f

bB8eh6qpG19d/JX7L/6y/WFffCGuP4t7Yks8E6/FywMV98VL8YO4RM+pOML/N5DO

xHvcPcd1C9czccXyqfjh4E8Xr7ZfXGyfsdbQpWeXFcCybhqnlGFErUCLRiuPneH0

DMT74inmJwSn4gbIvjm4+PsGAILUsQXAgoL1YXIVaaHdLATfsiXewQZHrV3ewTI3

4o/ZVle4npJ9uP8E12LNEzx9hdbZ5tgjdmWLnQWtdG2riEPmY7MEHW

 

 

TIA

John

 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 14 October 2019 10:29 AM UTC
  2. PowerBuilder
  3. # 7

What did you use for the Subject?

Try using a short (under 80 chars) subject using only Ascii characters.

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.