|
-
Feb 2nd, 2010, 08:28 PM
#1
Thread Starter
Addicted Member
Send Email using .Net 1.1
hello guys,
i want to send email to any public servers (e.g yahoo,msn,google,hotmail etc.).can you guide me where to start..
1.what do i need first
2.what class i use
3.how it works.
please share some sample code or any helpful links this would greatly appreciated..
thanks in advance
glen
Last edited by [gja]; Feb 4th, 2010 at 01:54 AM.
-
Feb 2nd, 2010, 11:44 PM
#2
Lively Member
Re: Send Email
I have made something very basic in the past, however it was using Gmail, it was for submitting error reports but you may be able to modify it to fit your needs. It has worked but I don't know if it's the best way to do it:
Code:
Imports System.Net.Mail
Public Class Form1
Private Sub Button1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Sets up SMTP
Dim smtpserver As New SmtpClient
Dim mail As New MailMessage
smtpserver.Credentials = New
'Declares info to use to send emails
Net.NetworkCredential("GmailUsernameHere", "Password")
smtpserver.Port = 587
smtpserver.Host = "smtp.gmail.com"
smtpserver.EnableSsl = True
'Creates the email message
mail = New MailMessage()
'Declares your email address
mail.From = New MailAddress("YourEmailHere")
'Declares where to send it
mail.To.Add("RecipientEmailHere")
'Message contents
mail.Subject = "Subject"
mail.Body = TextBox1.Text
'Sends the email
smtpserver.Send(mail)
Hope it helps. 
Edit: Added in ' comments for ease of understanding how it works.
-
Feb 4th, 2010, 01:21 AM
#3
Thread Starter
Addicted Member
Re: Send Email
Hello
I thinks this will work on .Net 2.0..bcoz,there's no such system.net.mail namespace in VB2003..im using VB2003 and .Net 1.1..
Im using System.web.Mail but i just dont get it work..i got error "Could not access CDO.Message object" what is this error means?
i already installed smtp server on my Server.
questions:
1.how do i configure my smtp server.
2.where can i see the name of my smtp server.
i made an app. that send email notices to all our customers.Can make this without using outlook?.since this is a mass email sending and am sure that some public servers would react bout this..maybe they will store my email into the spam folders..how will i handle this? please guide me..
many thanks..
glen
Last edited by [gja]; Feb 5th, 2010 at 12:12 AM.
-
Feb 5th, 2010, 12:58 AM
#4
Thread Starter
Addicted Member
Re: Send Email using .Net 1.1
hello there,
Sorry for re-posting..i up my post again coz i really need an answer to my questions.
please share some advice..thank you!
-
Feb 5th, 2010, 01:35 AM
#5
Re: Send Email using .Net 1.1
why use the 1.1 framework?
i have a link in my sig for sending emails, but i would recommend a new version of the framework for ease of use
-
Feb 5th, 2010, 02:05 AM
#6
Re: Send Email using .Net 1.1
You use the MailMessage class in System.Web.Mail rather than System.Net.Mail, which was only added with .NET 2.0.
http://www.google.com.au/search?q=sy...ient=firefox-a
-
Feb 5th, 2010, 02:30 AM
#7
Thread Starter
Addicted Member
Re: Send Email using .Net 1.1
reason of using .Net 1.1 is we already existing system written in vb2003.and i just need to add some functionality to it.
thanks
-
Feb 5th, 2010, 02:52 AM
#8
Thread Starter
Addicted Member
Re: Send Email using .Net 1.1
@jmcilhinney
thanks for the reply..
is .Net 2.0 compatible for vb2003?.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|