Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Email body

Hi guys. i am new round here and also very new to vb 2005. I have been scripting vbscript for just over a year but i am still very very new. That aside i have this bit of email code that i have converted over to vb 2005 express.

My issue is with the body line. As you can see is scrolls off the page to the right. Any ideas how i can make this scroll down the page so its easier to read.?

Many thanks to anyone who can help

Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress("EU-IT-Help-Desk@withersworldwide.com")
mail.To.Add("EU-New-User-Creation@withersworldwide.com")

'set the content
mail.Subject = "New User - " & strFirst & " " & strLast & " Account Details "
mail.IsBodyHtml = True
mail.Body = "****Automatic email****," & Environment.NewLine & "Please note London IT have created a new user account." & Environment.NewLine & "Name: " & strFirst & " " & strLast & " " & Environment.NewLine & "Initials: " & strUser & " " & Environment.NewLine & "Department: " & sDepartment & " " & Environment.NewLine & "Office Location: " & WithersOffice.Text & " " & Environment.NewLine & "Regards" & Environment.NewLine & "European IT Helpdesk" & Environment.NewLine & "Withers LLP" & Environment.NewLine & "+44 (0) 207 597 6440" & Environment.NewLine & "EU-IT-Help-Desk@withersworldwide.com" & Environment.NewLine & "****Please note this email was automatically generated from the IT User Creation Script****" & Environment.NewLine & "Please contact the European IT Helpdesk x6440 with any issues" & Environment.NewLine & "This Account has been created by: " & strLoggedonUser & ""

'send the message
Dim smtp As New SmtpClient("IP ADDRESS HERE")
smtp.Send(mail)
[1902 byte] By [cjwallaceUK] at [2007-11-11 10:25:09]
# 1 Re: Email body
For HTML messages, instead of Environment.NewLine use "<br />".
Phil Weber at 2007-11-11 20:47:57 >
# 2 Re: Email body
Hi mate. Thanks for the reply. I dont think you follow. the Mail.Body line scrolls of the page so in order to read the code i must scroll to the right which is not very good.

Any ideas?
cjwallaceUK at 2007-11-11 20:48:51 >
# 3 Re: Email body
Oh, sorry.

mail.Body = "****Automatic email****," & _
Environment.NewLine & "Please note London IT have created a new user account." & _
Environment.NewLine & "Name: " & strFirst & " " & strLast & " " & _
' etc.
Phil Weber at 2007-11-11 20:49:53 >
# 4 Re: Email body
Hi mate. Thanks mate thats what i was looking for.

Thanks again
cjwallaceUK at 2007-11-11 20:50:59 >