473,464 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Hyperlink in SMTPMail

I am trying to build an aspx page that will send customized emails to a list
of email addresses (in a SQL Server table) where each email has a customized
hyperlink. As part of the body of the outgoing message I want a section that
is something like:

=========================================
Click on the following link to verify your email address:
http://mysite.com/mypage.aspx?i=nnn
=========================================

where "nnn" is an integer pulled from the database for that row.

How can I accomplish this?

Wayne
Nov 19 '05 #1
5 1723
I found information on the URI object and tried that but the URL in the
resulting email is not showing up as a link? I see the correct URL but it is
not "clickable"?

Wayne

"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:uu**************@TK2MSFTNGP14.phx.gbl...
I am trying to build an aspx page that will send customized emails to a
list of email addresses (in a SQL Server table) where each email has a
customized hyperlink. As part of the body of the outgoing message I want a
section that is something like:

=========================================
Click on the following link to verify your email address:
http://mysite.com/mypage.aspx?i=nnn
=========================================

where "nnn" is an integer pulled from the database for that row.

How can I accomplish this?

Wayne

Nov 19 '05 #2
Step1 : Add a reference to System.Web.Mail

Step2 : Add the Imports System.Web.Mail Statements

Step 3: Use something like my code here, DONT FORGET TO CHANGE THE -
SMTPMAILSERVER Name, see below

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mm As New MailMessage

Dim body As New TextBox

body.Multiline = True

body.AppendText("=============================<BR> ")

body.AppendText("<a href=http://TrainingOn.net>TrainingOn.net For all your
Developer Training</a><BR>")

body.AppendText("=============================<BR> ")

mm.To = Yo*******@WhereYouWantItToGo.Com

mm.From = "Me@here.com"

mm.Subject = "Test Message"

mm.BodyFormat = MailFormat.Html

mm.Body = body.Text

SmtpMail.SmtpServer = "YOURSMTPMAILSERVERNAME"

Try

SmtpMail.Send(mm)

Catch ex As System.Web.HttpException

MsgBox(ex.InnerException.ToString)

End Try

End Sub



"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
I found information on the URI object and tried that but the URL in the
resulting email is not showing up as a link? I see the correct URL but it
is not "clickable"?

Wayne

"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:uu**************@TK2MSFTNGP14.phx.gbl...
I am trying to build an aspx page that will send customized emails to a
list of email addresses (in a SQL Server table) where each email has a
customized hyperlink. As part of the body of the outgoing message I want a
section that is something like:

=========================================
Click on the following link to verify your email address:
http://mysite.com/mypage.aspx?i=nnn
=========================================

where "nnn" is an integer pulled from the database for that row.

How can I accomplish this?

Wayne


Nov 19 '05 #3
Thanks.

Wayne

"Mad Murdoch" <ma*@here.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Step1 : Add a reference to System.Web.Mail

Step2 : Add the Imports System.Web.Mail Statements

Step 3: Use something like my code here, DONT FORGET TO CHANGE THE -
SMTPMAILSERVER Name, see below

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mm As New MailMessage

Dim body As New TextBox

body.Multiline = True

body.AppendText("=============================<BR> ")

body.AppendText("<a href=http://TrainingOn.net>TrainingOn.net For all your
Developer Training</a><BR>")

body.AppendText("=============================<BR> ")

mm.To = Yo*******@WhereYouWantItToGo.Com

mm.From = "Me@here.com"

mm.Subject = "Test Message"

mm.BodyFormat = MailFormat.Html

mm.Body = body.Text

SmtpMail.SmtpServer = "YOURSMTPMAILSERVERNAME"

Try

SmtpMail.Send(mm)

Catch ex As System.Web.HttpException

MsgBox(ex.InnerException.ToString)

End Try

End Sub



"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
I found information on the URI object and tried that but the URL in the
resulting email is not showing up as a link? I see the correct URL but it
is not "clickable"?

Wayne

"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:uu**************@TK2MSFTNGP14.phx.gbl...
I am trying to build an aspx page that will send customized emails to a
list of email addresses (in a SQL Server table) where each email has a
customized hyperlink. As part of the body of the outgoing message I want
a section that is something like:

=========================================
Click on the following link to verify your email address:
http://mysite.com/mypage.aspx?i=nnn
=========================================

where "nnn" is an integer pulled from the database for that row.

How can I accomplish this?

Wayne



Nov 19 '05 #4
Code for both languages

http://www.trainingon.net/Articles/TIP0002.htm

"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Thanks.

Wayne

"Mad Murdoch" <ma*@here.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Step1 : Add a reference to System.Web.Mail

Step2 : Add the Imports System.Web.Mail Statements

Step 3: Use something like my code here, DONT FORGET TO CHANGE THE -
SMTPMAILSERVER Name, see below

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mm As New MailMessage

Dim body As New TextBox

body.Multiline = True

body.AppendText("=============================<BR> ")

body.AppendText("<a href=http://TrainingOn.net>TrainingOn.net For all
your Developer Training</a><BR>")

body.AppendText("=============================<BR> ")

mm.To = Yo*******@WhereYouWantItToGo.Com

mm.From = "Me@here.com"

mm.Subject = "Test Message"

mm.BodyFormat = MailFormat.Html

mm.Body = body.Text

SmtpMail.SmtpServer = "YOURSMTPMAILSERVERNAME"

Try

SmtpMail.Send(mm)

Catch ex As System.Web.HttpException

MsgBox(ex.InnerException.ToString)

End Try

End Sub



"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
I found information on the URI object and tried that but the URL in the
resulting email is not showing up as a link? I see the correct URL but it
is not "clickable"?

Wayne

"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:uu**************@TK2MSFTNGP14.phx.gbl...
I am trying to build an aspx page that will send customized emails to a
list of email addresses (in a SQL Server table) where each email has a
customized hyperlink. As part of the body of the outgoing message I want
a section that is something like:

=========================================
Click on the following link to verify your email address:
http://mysite.com/mypage.aspx?i=nnn
=========================================

where "nnn" is an integer pulled from the database for that row.

How can I accomplish this?

Wayne



Nov 19 '05 #5

Mad Murdoch wrote:
Step1 : Add a reference to System.Web.Mail

Step2 : Add the Imports System.Web.Mail Statements

Step 3: Use something like my code here, DONT FORGET TO CHANGE THE - SMTPMAILSERVER Name, see below

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mm As New MailMessage

Dim body As New TextBox

body.Multiline = True

body.AppendText("=============================<BR> ")

body.AppendText("<a href=http://TrainingOn.net>TrainingOn.net For all your Developer Training</a><BR>")

body.AppendText("=============================<BR> ")

mm.To = Yo*******@WhereYouWantItToGo.Com

mm.From = "Me@here.com"

mm.Subject = "Test Message"

mm.BodyFormat = MailFormat.Html

mm.Body = body.Text

SmtpMail.SmtpServer = "YOURSMTPMAILSERVERNAME"

Try

SmtpMail.Send(mm)

Catch ex As System.Web.HttpException

MsgBox(ex.InnerException.ToString)

End Try

End Sub

You missed out Step 4:

Think about the sanity, in this day and age, of encouraging people to
click on links sent out in emails. This may not (in fact, reading the
initial blurb, almost certainly isn't) an internet banking system, but
it's still a principle worth sticking with.

Once the ONLY people sending clickable links in emails for account
information are the phishers, maybe people will stop clicking on them.

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jason | last post by:
Hi just a really quick simple question. Can you configure SmtpMail class in C# to use a different port? or does it have to be port 25? Thanks Jason
2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
6
by: Steve Chatham | last post by:
This ought to be simple, but I've not been able to figure out how to do this. I have a request to create a list from a sql database to be displayed in a datagrid on an asp web page. So far,...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
2
by: Edward | last post by:
Hello, everybody, I tried to send Email out using ASP.NET, but failed, here is the code of sending: -------------------------------------------------------------------------------- Try...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
2
by: kmbarz | last post by:
I'm trying to expand my horizons here by working through an ASP.Net book. When I do the example that uses: Line 55: Mail.From = "feedback@graymad.com" Line 56: ...
19
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.