Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sending an email with hyperlink

Reply
Thread Tools

Sending an email with hyperlink

 
 
JJ297
Guest
Posts: n/a
 
      08-10-2007
Could someone please tell me what I'm doing wrong?

When I click on the submit button under button click I have the
following code to send a generated email. I want to capture the
QuesID from that page and place that in a hyperlink to the user so it
will take them to the edit page.


Dim ocdoEmail As New Object
ocdoEmail = Server.CreateObject("CDO.Message")
ocdoEmail.To = Session("GetEmail")
ocdoEmail.From = Session("GetEmail")
ocdoEmail.Subject = "EDCS Question"
ocdoEmail.textBody = "Here is the question that was submitted
CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")

ocdoEmail.send()

Thanks.

 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      08-10-2007
you can make your email body HTML. that will allow you to show the link.
and this:

ocdoEmail.textBody = "Here is the question that was submitted
> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")



should be something like
ocdoEmail.textBody = "<a href='cpadamin.aspx?quesID=&
Request.QueryString('QuesID')'>link here</a>";

i forget the actual syntax but something like that


Mike



"JJ297" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Could someone please tell me what I'm doing wrong?
>
> When I click on the submit button under button click I have the
> following code to send a generated email. I want to capture the
> QuesID from that page and place that in a hyperlink to the user so it
> will take them to the edit page.
>
>
> Dim ocdoEmail As New Object
> ocdoEmail = Server.CreateObject("CDO.Message")
> ocdoEmail.To = Session("GetEmail")
> ocdoEmail.From = Session("GetEmail")
> ocdoEmail.Subject = "EDCS Question"
> ocdoEmail.textBody = "Here is the question that was submitted
> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")
>
> ocdoEmail.send()
>
> Thanks.
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      08-10-2007
Why are you using legacy COM when you have the System.Net.Mail namespace
which is managed code, to do this?
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



"JJ297" wrote:

> Could someone please tell me what I'm doing wrong?
>
> When I click on the submit button under button click I have the
> following code to send a generated email. I want to capture the
> QuesID from that page and place that in a hyperlink to the user so it
> will take them to the edit page.
>
>
> Dim ocdoEmail As New Object
> ocdoEmail = Server.CreateObject("CDO.Message")
> ocdoEmail.To = Session("GetEmail")
> ocdoEmail.From = Session("GetEmail")
> ocdoEmail.Subject = "EDCS Question"
> ocdoEmail.textBody = "Here is the question that was submitted
> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")
>
> ocdoEmail.send()
>
> Thanks.
>
>

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      08-10-2007
He still has to have the to, from, subject, body, etc.
So if he uses CDO or System.Net.Mail namespace, he still needs that
information


"Peter Bromberg [C# MVP]" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
> Why are you using legacy COM when you have the System.Net.Mail namespace
> which is managed code, to do this?
> -- Peter
> Recursion: see Recursion
> site: http://www.eggheadcafe.com
> unBlog: http://petesbloggerama.blogspot.com
> BlogMetaFinder: http://www.blogmetafinder.com
>
>
>
> "JJ297" wrote:
>
>> Could someone please tell me what I'm doing wrong?
>>
>> When I click on the submit button under button click I have the
>> following code to send a generated email. I want to capture the
>> QuesID from that page and place that in a hyperlink to the user so it
>> will take them to the edit page.
>>
>>
>> Dim ocdoEmail As New Object
>> ocdoEmail = Server.CreateObject("CDO.Message")
>> ocdoEmail.To = Session("GetEmail")
>> ocdoEmail.From = Session("GetEmail")
>> ocdoEmail.Subject = "EDCS Question"
>> ocdoEmail.textBody = "Here is the question that was submitted
>> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")
>>
>> ocdoEmail.send()
>>
>> Thanks.
>>
>>



 
Reply With Quote
 
JJ297
Guest
Posts: n/a
 
      08-10-2007
On Aug 10, 11:39 am, "Mike" <(E-Mail Removed)> wrote:
> He still has to have the to, from, subject, body, etc.
> So if he uses CDO or System.Net.Mail namespace, he still needs that
> information
>
> "Peter Bromberg [C# MVP]" <(E-Mail Removed)> wrote
> in messagenews:(E-Mail Removed)...
>
>
>
> > Why are you using legacy COM when you have the System.Net.Mail namespace
> > which is managed code, to do this?
> > -- Peter
> > Recursion: see Recursion
> > site: http://www.eggheadcafe.com
> > unBlog: http://petesbloggerama.blogspot.com
> > BlogMetaFinder: http://www.blogmetafinder.com

>
> > "JJ297" wrote:

>
> >> Could someone please tell me what I'm doing wrong?

>
> >> When I click on the submit button under button click I have the
> >> following code to send a generated email. I want to capture the
> >> QuesID from that page and place that in a hyperlink to the user so it
> >> will take them to the edit page.

>
> >> Dim ocdoEmail As New Object
> >> ocdoEmail = Server.CreateObject("CDO.Message")
> >> ocdoEmail.To = Session("GetEmail")
> >> ocdoEmail.From = Session("GetEmail")
> >> ocdoEmail.Subject = "EDCS Question"
> >> ocdoEmail.textBody = "Here is the question that was submitted
> >> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")

>
> >> ocdoEmail.send()

>
> >> Thanks.- Hide quoted text -

>
> - Show quoted text -


Thanks Mike I tried what you suggested but I'm getting this in the
email? What am I missing?

<a href='cpadamin.aspx?quesID=& Request.QueryString('QuesID')'>link
here</a>

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      08-10-2007
do you have the email body set to HTML?
"JJ297" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> On Aug 10, 11:39 am, "Mike" <(E-Mail Removed)> wrote:
>> He still has to have the to, from, subject, body, etc.
>> So if he uses CDO or System.Net.Mail namespace, he still needs that
>> information
>>
>> "Peter Bromberg [C# MVP]" <(E-Mail Removed)>
>> wrote
>> in messagenews:(E-Mail Removed)...
>>
>>
>>
>> > Why are you using legacy COM when you have the System.Net.Mail
>> > namespace
>> > which is managed code, to do this?
>> > -- Peter
>> > Recursion: see Recursion
>> > site: http://www.eggheadcafe.com
>> > unBlog: http://petesbloggerama.blogspot.com
>> > BlogMetaFinder: http://www.blogmetafinder.com

>>
>> > "JJ297" wrote:

>>
>> >> Could someone please tell me what I'm doing wrong?

>>
>> >> When I click on the submit button under button click I have the
>> >> following code to send a generated email. I want to capture the
>> >> QuesID from that page and place that in a hyperlink to the user so it
>> >> will take them to the edit page.

>>
>> >> Dim ocdoEmail As New Object
>> >> ocdoEmail = Server.CreateObject("CDO.Message")
>> >> ocdoEmail.To = Session("GetEmail")
>> >> ocdoEmail.From = Session("GetEmail")
>> >> ocdoEmail.Subject = "EDCS Question"
>> >> ocdoEmail.textBody = "Here is the question that was submitted
>> >> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")

>>
>> >> ocdoEmail.send()

>>
>> >> Thanks.- Hide quoted text -

>>
>> - Show quoted text -

>
> Thanks Mike I tried what you suggested but I'm getting this in the
> email? What am I missing?
>
> <a href='cpadamin.aspx?quesID=& Request.QueryString('QuesID')'>link
> here</a>
>



 
Reply With Quote
 
JJ297
Guest
Posts: n/a
 
      08-13-2007
On Aug 10, 3:10 pm, "Mike" <(E-Mail Removed)> wrote:
> do you have the email body set to HTML?"JJ297" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) ups.com...
>
>
>
> > On Aug 10, 11:39 am, "Mike" <(E-Mail Removed)> wrote:
> >> He still has to have the to, from, subject, body, etc.
> >> So if he uses CDO or System.Net.Mail namespace, he still needs that
> >> information

>
> >> "Peter Bromberg [C# MVP]" <(E-Mail Removed)>
> >> wrote
> >> in messagenews:(E-Mail Removed)...

>
> >> > Why are you using legacy COM when you have the System.Net.Mail
> >> > namespace
> >> > which is managed code, to do this?
> >> > -- Peter
> >> > Recursion: see Recursion
> >> > site: http://www.eggheadcafe.com
> >> > unBlog: http://petesbloggerama.blogspot.com
> >> > BlogMetaFinder: http://www.blogmetafinder.com

>
> >> > "JJ297" wrote:

>
> >> >> Could someone please tell me what I'm doing wrong?

>
> >> >> When I click on the submit button under button click I have the
> >> >> following code to send a generated email. I want to capture the
> >> >> QuesID from that page and place that in a hyperlink to the user so it
> >> >> will take them to the edit page.

>
> >> >> Dim ocdoEmail As New Object
> >> >> ocdoEmail = Server.CreateObject("CDO.Message")
> >> >> ocdoEmail.To = Session("GetEmail")
> >> >> ocdoEmail.From = Session("GetEmail")
> >> >> ocdoEmail.Subject = "EDCS Question"
> >> >> ocdoEmail.textBody = "Here is the question that was submitted
> >> >> CDPAdmin.aspx?quesID =" & Request.QueryString("QuesID")

>
> >> >> ocdoEmail.send()

>
> >> >> Thanks.- Hide quoted text -

>
> >> - Show quoted text -

>
> > Thanks Mike I tried what you suggested but I'm getting this in the
> > email? What am I missing?

>
> > <a href='cpadamin.aspx?quesID=& Request.QueryString('QuesID')'>link
> > here</a>- Hide quoted text -

>
> - Show quoted text -


Thanks, I just set it to that and now it's okay but its still not
grabbing the QuesID

Here's my stored procedure:
REATE procedure AddQuestion

@quesdate datetime,
@topicid int,
@questions varchar(1000)

AS
Set NOCOUNT ON

INSERT INTO QuesNAns
(quesdate,topicid, questions)

values
(@quesdate,
@topicid,
@questions)

SET NOCOUNT OFF

SELECT SCOPE_IDENTITY() AS [SCOPE_IDENTITY]
GO

Here's my code behind page:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim question As String = Txtquestion.Text

Dim conn As New Data.SqlClient.SqlConnection("Data
Source=seb2a54;Initial Catalog=EDCSFAQS;Persist Security
Info=True;User ID=EDCSFAQUser;Password=fax")

Dim cmd As New Data.SqlClient.SqlCommand
With cmd
.Connection = conn 'the connection
.CommandType = Data.CommandType.StoredProcedure
.CommandText = "AddQuestion"
.Parameters.AddWithValue("@topicid",
CInt(DropDownList1.SelectedItem.Value))
.Parameters.AddWithValue("@quesdate", QuesDate.Text)
.Parameters.AddWithValue("@questions", Txtquestion.Text)



End With

Try
conn.Open()
Dim x As Integer
x = cmd.ExecuteScalar
command.ExecuteNonQuery()

Catch ex As Data.SqlClient.SqlException
Throw New ApplicationException("An error occurred while
trying to insert the record")
Finally
conn.Close()
End Try

lbloutcome.Text = "Your entry was submitted into the
database."

Dim ocdoEmail As New Object
ocdoEmail = Server.CreateObject("CDO.Message")
ocdoEmail.To = Session("GetEmail")
ocdoEmail.From = Session("GetEmail")
ocdoEmail.CC = "(E-Mail Removed)"
ocdoEmail.Subject = "EDCS Question"
ocdoEmail.HTMLBody = "<a href=""http://seb2a54/cdpedcsfaqs/
cdpadminEditpage.aspx?quesid=" & Request.QueryString("QuesID") & """>
Click to view question that was submitted.</a>"


ocdoEmail.send()

End Sub

Any suggestions?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the correct email format when sending email using sqldatareader rote ASP .Net 8 04-17-2008 02:14 AM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM



Advertisments