Solved

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

Posted on 2015-02-20
3
159 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

809 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