Juan T. Llibre said:
re:
That is a text link.
You can't use HTML in text links.
But the problem is I can't seem to use linefeeds,either.
Here is the program that sends 2 <br>s and it shows on the email we are
trying to send:
*********************************************************************
<%@ Page Language="VB" trace="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
sub sendEmail(sender As Object, e As System.EventArgs )
Dim mailTo as String = "Email: <a
href=""mailto:
[email protected]?subject=Our test&body=This is line
1<br><br>This is line2 "">to Tom</a>"
Dim Message As New MailMessage()
message.From = "(e-mail address removed)"
message.To = "(e-mail address removed)"
message.Subject = "Email test"
message.Body = mailTo
trace.warn("mailto = " & mailto)
message.Body = mailTo
message.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = "localhost"
smtpMail.Send(message)
end sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form runat="server">
Send Email: <asp:Button ID="btnEmail" Text="Send" OnClick="SendEMail"
runat="server" />
</form>
</body>
</html>
**********************************************************************
When I press the link my email program comes up with:
This is line 1<br><br>This is line2
If I change the program to change the <br><br> to vbCrLf, I get the
following program:
********************************************************************
<%@ Page Language="VB" trace="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
sub sendEmail(sender As Object, e As System.EventArgs )
Dim mailTo as String = "Email: <a
href=""mailto:
[email protected]?subject=Our test&body=This is line
1<br><br>This is line2 "">to Tom</a>"
Dim Message As New MailMessage()
message.From = "(e-mail address removed)"
message.To = "(e-mail address removed)"
message.Subject = "Email test"
message.Body = mailTo
mailto = mailTo.replace("<br>",vbCrLf)
trace.warn("mailto = " & mailto)
message.Body = mailTo
message.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = "localhost"
smtpMail.Send(message)
end sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form runat="server">
Send Email: <asp:Button ID="btnEmail" Text="Send" OnClick="SendEMail"
runat="server" />
</form>
</body>
</html>
*********************************************************************
If you look at the web page the mailto line is (notice that it skips 2
lines - so the CRLF seems to be there:
**********************************************************************
<a href="mailto:
[email protected]?subject=Our test&body=This is line 1
This is line2 ">to Tom</a><BR>
*********************************************************************
But when I press the buttom the email program comes up and this is
displaying:
This is line 1This is line2
It seems to have stripped out the CRLFs.
Tom