realbasic-nug
[Top] [All Lists]

SMTP Format help needed

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: SMTP Format help needed
From: Tim Jones <tjmac@tolisgroup.com>
Date: Wed, 30 Jul 2008 14:37:37 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
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>


<Prev in Thread] Current Thread [Next in Thread>