Solved

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

Posted on 2015-02-20
3
163 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
[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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

739 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