sending emails from ASP.Net using VB.net

  • Thread starter Thread starter Paul Wilson
  • Start date Start date
P

Paul Wilson

Hi guys,

In classic ASP, i used to enable emailing from a webpage using the following
code,
lcData = "mailto:?CC=" + lcCC + "&subject=" + lcSubject + "&body=" + lcBody
window.parent.navigate(lcData)

Where lcData, lcCc, lcSubject and lcBody are variables.
When this was done, a New Email was created on the CLIENTS computer (email
form).

I want to be able to do the very same thing, but using ASP.Net.

NOTE : I don't want to send emails from the server side, rather from the
Client Side.

Regards,
Paul
 
Hi Paul,

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Me.Button1.Text = "Send Mail"
Me.Button1.Attributes("onClick") =
"window.location='mailto:[email protected]?subject=Cor demo&body=I hope this
helps?';"
End If
End Sub

As said in the mail, I hope this helps?

Cor
 
Brilliant, thanx a lot.
Mimicking a Client side script. (but without having to write any client side
scripts)

Thanx.
 
Cor,
Is this supposed to work on vs 2002 - webforms also? I put the following
code in the page load and nothing?

Thanks

btnEMail.Attributes("onClick") =
"window.location='mailto:[email protected]?subject=Cor demo&body=I hope this"
 
Hi Tony,

I would not know why not, not that I am sure, however did you try it with
this?

demo&body=I hope this;'"

;'

Otherwise it should give an error

Cor
 
Back
Top