Solved

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

Posted on 2015-02-20
3
149 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
Comment Utility
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 1

Author Comment

by:PNRT
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

743 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

12 Experts available now in Live!

Get 1:1 Help Now