Solved

Webmatrix & Razor & vbhtml.  How to include pagebreaks when sending a mail from webpage

Posted on 2015-02-20
3
153 Views
Last Modified: 2015-02-27
Hi Experts.  I am sending a mail with the following which works correctly

Dim MailBody As string
MailBody = "1" & "2"
WebMail.Send(to:= "fred@google.com", subject:= "Testing the Mail", body:= MailBody)

But I need to format MailBody and cannot get any formatting to work
Not even line breaks

MailBody = "1" &  Environment.NewLine  & "2"

Doesn't work either.

Anyone know how to add line breaks to this?
Also is it possible to do an html mail with webmail?

Many Thanks
0
Comment
Question by:PNRT
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40621732
Code in email is basically going to be ignored by email programs and may even trigger a security alert.  As for HTML, each clint has ist own subset that it supports, and in addition the user has the option of blocking anything except text.

If You use any CSS in the email it is guaranteed to fail in many email clients, and gmail in particular will strip out any CSS that does not conform to its stylesheet.

As for adding line breaks, if the text contains line breaks then the client is generally going to render them As long as you are not using HTML.

Cd&
0
 
LVL 2

Author Comment

by:PNRT
ID: 40622721
Thank you for your reply
You say "if the text contains line breaks then the client is generally going to render them  ".
Do you perhaps know how to add line breaks to the above code?  As you can see, I'm not using HTML
but the line breaks as show above are still not working.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40623525
I don't see anything that looks like a linefeed that is going to be processed as anything by white space if you want HTML in the client to use linbreaks, then you need to use the HTHL break tag <br />

Cd&
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

912 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now