|
|
|
start date: Fri, 10 Aug 2007 07:27:20 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
JJ297
|
|
2
Mike
|
|
3
Peter Bromberg [C# MVP]
|
|
4
Mike
|
|
5
JJ297
|
|
6
Mike
|
|
7
JJ297
|
Sending an email with hyperlink
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.
Date:Fri, 10 Aug 2007 07:27:20 -0700
Author:
|
Re: Sending an email with hyperlink
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" wrote in message
news:1186756040.067386.123470@x40g2000prg.googlegroups.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.
>
Date:Fri, 10 Aug 2007 10:53:51 -0400
Author:
|
RE: Sending an email with hyperlink
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.
>
>
Date:Fri, 10 Aug 2007 08:30:05 -0700
Author:
|
Re: Sending an email with hyperlink
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]" wrote
in message news:88F8BE00-2620-4BDF-B0BB-F47F9F72B23C@microsoft.com...
> 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.
>>
>>
Date:Fri, 10 Aug 2007 11:39:39 -0400
Author:
|
Re: Sending an email with hyperlink
On Aug 10, 11:39 am, "Mike" 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]" wrote
> in messagenews:88F8BE00-2620-4BDF-B0BB-F47F9F72B23C@microsoft.com...
>
>
>
> > 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>
Date:Fri, 10 Aug 2007 09:13:26 -0700
Author:
|
Re: Sending an email with hyperlink
do you have the email body set to HTML?
"JJ297" wrote in message
news:1186762406.437372.30010@z24g2000prh.googlegroups.com...
> On Aug 10, 11:39 am, "Mike" 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]"
>> wrote
>> in messagenews:88F8BE00-2620-4BDF-B0BB-F47F9F72B23C@microsoft.com...
>>
>>
>>
>> > 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>
>
Date:Fri, 10 Aug 2007 15:10:34 -0400
Author:
|
Re: Sending an email with hyperlink
On Aug 10, 3:10 pm, "Mike" wrote:
> do you have the email body set to HTML?"JJ297" wrote in message
>
> news:1186762406.437372.30010@z24g2000prh.googlegroups.com...
>
>
>
> > On Aug 10, 11:39 am, "Mike" 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]"
> >> wrote
> >> in messagenews:88F8BE00-2620-4BDF-B0BB-F47F9F72B23C@microsoft.com...
>
> >> > 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 = "nina.childress@ssa.gov"
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?
Date:Mon, 13 Aug 2007 07:39:54 -0700
Author:
|
|
|