PC Review


Reply
Thread Tools Rate Thread

! and spaces added to email when sending email in .net application

 
 
Nicola
Guest
Posts: n/a
 
      12th Nov 2003
When using the NewMail.Body object, ! and spaces are being added into
the email after the email has been sent. Has anyone else had this
problem or even better a solution??
 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      12th Nov 2003
Hi Nicola,

Paste in some code, maybe we can help you?

(When you do that first to the notebook and then copy from there in the
mail, otherwise we get a very long message)

Cor

> When using the NewMail.Body object, ! and spaces are being added into
> the email after the email has been sent. Has anyone else had this
> problem or even better a solution??



 
Reply With Quote
 
 
 
 
Nicola
Guest
Posts: n/a
 
      12th Nov 2003
"Cor" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> Hi Nicola,
>
> Paste in some code, maybe we can help you?
>
> (When you do that first to the notebook and then copy from there in the
> mail, otherwise we get a very long message)
>
> Cor
>
> > When using the NewMail.Body object, ! and spaces are being added into
> > the email after the email has been sent. Has anyone else had this
> > problem or even better a solution??


Cor,
Here's the code to build up email

strLine1 = "<table border='0' cellpadding='0' cellspacing='0'
width='600'>"
strLine2 = "<tr><td width='100%'><p align='right'>Permit
Number......................</p></td></tr>"
strLine3 = "<tr><td width='100%'><p align='right'>Permit
Date...........................</p></td></tr>"
strLine4 = "<tr><td width='100%' align='center'><b>GLASGOW
CITY COUNCIL</b></td></tr>"
strLine5 = "<tr><td width='100%' align='center'><b>LAND
SERVICES</b></td></tr>"
strLine6 = "<tr><td width='100%'
align='center'><b>PERMISSION TO OCCUPY PORTIONS OF A
ROAD</b></td></tr>"
strLine7 = "<tr><td width='100%'>Glasgow City Council in
exercise of their powers under Section 59 of the Roads </td></tr>"
strLine8 = "<tr><td width='100%'>(Scotland) Act 1984 (and
under Section 14 of the Road Traffic Regulation Act 1984) </td></tr>"
strLine9 = "<tr><td width='100%'>hereby grant permission
to :-</td></tr>"
strLine10 = "<tr><td width='100%'>Name:</td></tr>"
strLine101 = "<tr><td width='100%'>" & strName &
"</td></tr>"
strLine11 = "<tr><td width='100%'>Address:</td></tr>"
strLine102 = "<tr><td width='100%'>" & strFlat &
strHouseName & strAddress & "</td></tr>"
strLine12 = "<tr><td width='100%'>Postcode: " & strPcode &
"</td></tr>"
strLine13 = "<tr><td width='100%'>Telephone No.: " &
strPhone & "</td></tr>"
strLine14 = "<tr><td width='100%'>Fax
No.:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & strFax &
"</td></tr>"
strLine15 = "<tr><td
width='100%'>E-mail:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
& strEmail & "</td></tr>"
strLine16 = "<tr><td width='100%'>to place or cause to be
placed a Simon Tower on the carriageway of</td></tr>"
strLine17 = "<tr><td width='100%'>" & strCarriageway &
"</td></tr>"
strLine18 = "<tr><td width='100%'>From " & strDateFrom & "
To " & strDateTo & "</td></tr>"
strLine19 = "<tr><td width='100%'>subject to the
conditions specified in Appendix II and hereby authorise and
require</td></tr>"
strLine103 = "<tr><td width='100%''>the said (Name) " &
strContact & "</td></tr>"
strLine20 = "<tr><td width='100%'>to place on the highway
such traffic signs as may be necessary to comply with the </td></tr>"
strLine21 = "<tr><td width='100%'>conditions of this
permission.</td></tr>"
strLine22 = "<tr><td
width='100%'>---------------------------------------------------------------------------------------------------------------</td></tr>"
strLine23 = "<tr><td width='100%'><font size = '1'>OFFICE
USE ONLY</font></td></tr>"
strLine24 = "<tr><td
width='100%'>Operations_Manager...................................................................Date:......................</td></tr>"
strLine25 = "<tr><td
width='100%'>----------------------------------------------------------------------------------------------------------------</td></tr>"
strLine26 = "<tr><td width='100%'>Appendix I</td></tr>"
strLine104 = "<tr><td width='100%'>Sketch plans showing
proposed location of Crane and details of dimensions with </td></tr>"
strLine105 = "<tr><td width='100%'>outriggers in use.
Permits will be issued with the condition that a plan (if required)"
strLine108 = "<tr><td width='100%'>is provided by post or
fax.</td></tr>"
strLine27 = "<tr><td width='100%'>Appendix II</td></tr>"
strLine106 = "<tr><td width='100%'>Conditions pertaining
to this permission</td></tr>"
strLine109 = "<tr><td
width='100%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>"
strLine28 = "<tr><td width='100%'>I hereby agree to comply
with the conditions.</td></tr>"
strLine107 = "<tr><td
width='100%'>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>"
strLine29 = "<tr><td width='100%'>To be signed by
applicant on receipt..............................................</td></tr>"
strLine110 = "<tr><td
width='100%'>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>"
strLine30 = "<tr><td width='100%'><b>AUTHORISATION
STAMP</b></td></tr>"
strLine111 = "<tr><td width='100%'>This certificate must
be shown if requested to a policeman or to any officer of Glasgow City
Council. It is valid only if if carries the Glasgow City Council stamp
of authorisation and it is a condition that the opening be made within
a period of ten days from the date of issue.</td></tr>"
strLine112 = "<tr><td
width='100%'>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>"
strLine31 = "<tr><td width='100%'>This authorised permit
is to be&nbsp;" & strDelivery & "</td></tr>"
strLine32 = "</table>"

Code for email class
Public Class gccEmail
' public EMail Class for sending an email using information from
form
' The four Parameters to send using SendMail Function are:
' MailFrom - Addree where Email is from (string)
' MailTo - Address where Email to be sent (string)
' MailSubject - Description/Subject of the Email (string)
' MailBody - The Text of the Email (string)
' A true or False Boolean value is returned
'(IF True there is no errors and email is sent IF False there
are errors and no email sent)
Public Shared Function SendMail(ByVal MailFrom As String, ByVal
MailTo As String, ByVal MailSubject As String, ByVal MailBody As
String) As Boolean
Dim NewMail As New MailMessage()
Try
If MailFrom <> "" Then
NewMail.From = MailFrom
ElseIf MailFrom = "" Then
NewMail.From = "(E-Mail Removed)"
End If
NewMail.Body = MailBody
NewMail.To = MailTo
NewMail.Subject = MailSubject
NewMail.BodyFormat = MailFormat.Html
NewMail.Priority = MailPriority.Normal


SmtpMail.SmtpServer = "HAHTsitemail"
SmtpMail.Send(NewMail)
Catch
Return False
End Try
Return True
End Function
End Class
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      12th Nov 2003
Hi Nicola,

I see in your message some (incomplete) code to put HTML lines on a webpage.

A normal shared mailfunction, that will be activated by

SendMail(MailFrom, MailTo , MailSubject, MailBody)

With that function I see as far as I can see it now nothing wrong

But there is is a lot of generated HTML code, from what I asume you make
the MailBody, (the code is not there) did you try it with just an empty
body, I think that is the best approach to see it the ! is by the HTML or
just by something else.

Cor



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I remove leading spaces and leave the remianing spaces w =?Utf-8?B?RGViaQ==?= Microsoft Excel Worksheet Functions 6 28th Feb 2007 04:29 PM
Application.Run(<ApplicationContext>) Error 'Item has already been added. Key in dictionary: "- 1" key being added: "- 1"' Ralf Gedrat Microsoft VB .NET 0 3rd May 2005 10:58 AM
How can I replace single spaces with double spaces in a document . =?Utf-8?B?QW1lcmljbkpld2w=?= Microsoft Word Document Management 5 27th Feb 2005 05:22 AM
I cannot type two sequential letters or spaces or back spaces? =?Utf-8?B?VExUaG9tYXM=?= Microsoft Word Document Management 1 30th Nov 2004 09:02 AM
Help copying a range with spaces to a range without spaces Andy Microsoft Excel Programming 1 23rd Sep 2003 04:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:34 PM.