Menu

Body Text not formatted correctly

Help
Anonymous
2003-03-21
2003-03-25
  • Anonymous

    Anonymous - 2003-03-21

    Hi, I just started using OpenSMTP and it seems to be exactly what I was looking for! Thanks guys! However, I am having a problem and perhaps someone can help me. When I send a message using OpenSMTP the body text is not formatted correctly - it appears that all the whitespace characters have been removed. When I send the same message, same setup, except us the .NET MailMessage components the message sends fine.

    I believe I am probably just not setting some property and I have tried to figure out which one but to no avail. My next step is to go through the source code, however I thought someone might be able to solve the problem quickly! Thanks!

    Smoke

     
    • Ian Stallings

      Ian Stallings - 2003-03-24

      Please post the code you use when you receive this error. This will help us identify the bug.

       
    • Anonymous

      Anonymous - 2003-03-24

      Sorry, for not posting this originally. Thanks for any help!

          '##SUMMARY Method to actually send the mail
          Private Function SendMailHelper(ByVal recipient As String, ByVal sender As String, ByVal subject As String, ByVal body As String, ByVal attachmentsPath As String) As Boolean
              Dim objMessage As MailMessage
              Dim objServer As Smtp
              Dim strFiles() As String
              Dim strCurrentFile As String

              'instantiate the server
              objServer = New Smtp(ConfigurationSettings.AppSettings.Item("Server"), 25)

              'setup logon credentials
              objServer.Username = ConfigurationSettings.AppSettings.Item("Username")
              objServer.Password = ConfigurationSettings.AppSettings.Item("Password")

              'instantiate the message
              objMessage = New MailMessage()

              'setup the properties
              objMessage.From = New EmailAddress(sender)
              objMessage.Subject = subject
              objMessage.Body = body
              objMessage.AddRecipient(recipient, AddressType.To)

              'get the attachments and add them to the message
              strFiles = Directory.GetFiles(Me.Context.Request.PhysicalApplicationPath & attachmentsPath)

              For Each strCurrentFile In strFiles
                  'attach the file to the message
                  objMessage.AddAttachment(strCurrentFile.Trim())
              Next

              'send the message
              objServer.SendMail(objMessage)

              'return result
              Return True
          End Function

       
    • Ian Stallings

      Ian Stallings - 2003-03-25

      Thanks, I will test this when I get home tonight. What version of OpenSmtp are you using? Is it the latest?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.