E-mails through windows form

Jupiler

New member
Joined
Dec 9, 2007
Messages
3
Programming Experience
1-3
I'd like to send a mail with the contents of 2 textboxes to my email adres.
I have been following some tutorials on the internet about doing this and came onto this code.

VB.NET:
        Dim my_email As System.Web.Mail.SmtpMail
        Dim from As String = "emailadres@emailsadres.com"
        Dim mailto As String = "myemailadres@GMAIL.com"
        Dim subject As String = "test"
        Dim body As String = txtName.Text & " " & txtFirstname.Text
        my_email.SmtpServer = "smtp.gmail.com"
        my_email.Send(from, mailto, subject, body)


This works, until it gives an error after a while (translated):

VB.NET:
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll

Additional information: Can't get access to the object: CDO.Message.

What do i do ?

I'm using vb.net 2003, i'd like to use gmail as reciever of the mails.
If you need any more info just ask here, or pm me


Pieter.
 
Thanks for the link! It gave me some usefull information but still the problem is not solved.

I don't have my computer set up as a server (using regular xp home), because I'm trying to test this from the client side. Is this a good way to work, or will it only work when I use xp pro with IIS?
 
You can send email with System.Web.Mail on Windows XP Home. Try with the SMTP server address your ISP has given you.
 
Back
Top