Xojo Conferences
XDCMay2019MiamiUSA

SMTP Format help needed (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Re: XML transform
Next thread: Looking for a way query a Windows system for an icon associated with a filename extension


FolderItem--IsReadable   -   Claude Stone
  SMTP Format help needed   -   Tim Jones
   Re: SMTP Format help needed   -   Eric de La Rochette
   Re: SMTP Format help needed   -   Tim Jones
   Re: SMTP Format help needed   -   Steve Garman
    Re: SMTP Format help needed   -   Tim Jones

SMTP Format help needed
Date: 30.07.08 22:37 (Wed, 30 Jul 2008 14:37:37 -0700)
From: Tim Jones
Hi Folks,

In dealing with the RB EmailMessage class, I've gotten everything
working except the formatting of the body text endofline. I know that
the RFC says to use 13/10, but all attempts have still resulted in my
message body becoming one long line.

Here's the pertinent part of my code:

Dim Mail As New EmailMessage
Dim theSocket As MySocket // subclass of SMTPSocket

Mail.Subject = "Job Report - " + BackupLabel
Mail.FromAddress = WPreferences.efSMTPFromAddress.Text
Mail.BodyPlainText = ReplaceLineEndings(MailBody,
EndOfLine.Macintosh, EndOfLine.Windows)
Mail.Headers.AppendHeader "Content-Type", "text/plain;
charset=""ISO-8859-1"""
Mail.Headers.AppendHeader "Content-Transfer-Encoding", "7bit"
Mail.Headers.AppendHeader "X-Mailer","LE Mail Agent"
For x = 1 To CountFields(MailTo, ",")
Mail.AddRecipient(Trim(NthField(MailTo, ",", x)))
Next
TheSocket.Messages.Append Mail
TheSocket.SendMail

I've also tried specifying Chr(13)+Chr(10) in case EndOfLine.Windows
wasn't getting processed, but no matter what I provide, the body is
one long line in "some" mail scenarios. If I mail myself and open the
mail in Apple Mail, it looks correct. However, if I mail my .mac
account and retrieve the message in Apple Mail, the body is a long
single line. Also, sending the mail to hotmail and gmail result in
the badly formatted result.

Any ideas of what might be happening here or something I've missed?

Thanks,
Tim

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: SMTP Format help needed
Date: 30.07.08 22:56 (Wed, 30 Jul 2008 23:56:55 +0200)
From: Eric de La Rochette

Le 30 juil. 08 à 23:37, Tim Jones a écrit :

> Mail.BodyPlainText = ReplaceLineEndings(MailBody,
> EndOfLine.Macintosh, EndOfLine.Windows)

Isn't the ReplaceLineEndings function supposed to take 2 parameters ?
like:
result = ReplaceLineEndings( SourceString, LineEnding )

> I've also tried specifying Chr(13)+Chr(10) in case EndOfLine.Windows
> wasn't getting processed

Did you try

Mail.BodyPlainText = ReplaceLineEndings(MailBody,
Encodings.ISOLatin1.Chr(13) + Encodings.ISOLatin1.Chr(10))

Just a thought, not a certitude.

Eric.



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: SMTP Format help needed
Date: 30.07.08 23:04 (Wed, 30 Jul 2008 15:04:10 -0700)
From: Tim Jones
On Jul 30, 2008, at 2:37 PM, Tim Jones wrote:

> Hi Folks,
>
> In dealing with the RB EmailMessage class, I've gotten everything
> working except the formatting of the body text endofline. I know
> that the RFC says to use 13/10, but all attempts have still resulted
> in my message body becoming one long line.

Doh! My checkbox for determining that I should use a specified SMTP
server (rather than sending directly) was not being seen in my mail
class and I was always sending directly. I'd used the wrong EOL
encoding on the direct transmissions. The use of
ReplaceLineEndings(MailBody, EndOfLine.Windows) does its job.

Tim

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: SMTP Format help needed
Date: 30.07.08 23:13 (Wed, 30 Jul 2008 23:13:14 +0100)
From: Steve Garman
> Mail.BodyPlainText = ReplaceLineEndings(MailBody,
> EndOfLine.Macintosh, EndOfLine.Windows)

Isn't that too many parameters?

Don't you mean

Mail.BodyPlainText = ReplaceLineEndings(MailBody, EndOfLine.Windows)

Re: SMTP Format help needed
Date: 30.07.08 23:32 (Wed, 30 Jul 2008 15:32:24 -0700)
From: Tim Jones
Sorry guys, bad edit in my cop-n-paste...

On Jul 30, 2008, at 3:13 PM, Steve Garman wrote:

>> Mail.BodyPlainText = ReplaceLineEndings(MailBody,
>> EndOfLine.Macintosh, EndOfLine.Windows)
>
> Isn't that too many parameters?
>
> Don't you mean
>
> Mail.BodyPlainText = ReplaceLineEndings(MailBody, EndOfLine.Windows)
>
> --
> Steve Garman
> Using RB2008r2 Professional on Windows Vista Ultimate
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>