[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Characters appearing in email sent via SMTP

Posted on 2006-11-05
5
Medium Priority
?
481 Views
Last Modified: 2010-04-07
Hi,

I've written an application for my company that will send an automated email when a certain condition has been met. The text for these emails originates from a text file. When the email has been sent and arrives in a users mail box, an exclamation mark appears at approximately character 990.

I've done a test just sending the characters 1234567890 and its nothing to do with the text file, and I've played with bodyencoding and bodyformat to no avail. Any ideas?

       With CfH_Message
            .From = From
            .To = To
            .Subject = Subject
            .Body = Message
            .BodyFormat = MailFormat.Html
            .BodyEncoding = System.Text.Encoding.Default
        End With
        SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("SMTPServerAddress")
        SmtpMail.Send(CfH_Message)


using the 1234567890 the results are as below (note the ! towards the end). The ! does NOT appear in the text email message. The proper text is in the form of a Dear Jo Bloggs email to a user, who happened to notice the exclamation mark towards the end of the email amongst various words (depending on the email). How has it appeared? This has been added AFTER the smtpmail.send. How can it be cured?


12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789! 01234567890
0
Comment
Question by:obyapka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 12

Expert Comment

by:sandip132
ID: 17879012
Try this:
.BodyEncoding = MailFormat.Base64
0
 
LVL 1

Author Comment

by:obyapka
ID: 17879880
MailFormat.Base64 does not appear as an option - only .HTML and .TEXT appear.

btw I'm using ASP.NET v1.1
0
 
LVL 1

Author Comment

by:obyapka
ID: 17879910
MailEncoding.Base64 exists but setting .BodyEncoding to this results in
"Value of type 'System.Web.Mail.MailEncoding' cannot be converted to 'System.Text.Encoding"

I'm using Imports System.Web.Mail, allowing me to do  Dim Cfh_Message As New MailMessage

examples that I've seen on the net that use MailEncoding.Base64 appear to use System.Web.Util, but if I use this I cannot create a mail object as above!!! (Type MailMessage is not defined). Grrrrr


0
 
LVL 15

Accepted Solution

by:
crisco96 earned 375 total points
ID: 17880139
There's a strange bug where if you have a string of length 512 or more without a line break random exclamation points appear in the email body. Add some code to insert a line break every 400-500 characters.
0
 
LVL 1

Author Comment

by:obyapka
ID: 17886089
I discovered a similar idea - see http://www.systemwebmail.com/faq/4.4.5.aspx - need to do a vbcrlf after every paragraph - I've applied a patch and it appears to work!! :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question