|
-
Nov 19th, 2003, 09:45 AM
#1
Thread Starter
Fanatic Member
Send Email to Internet Users
My VB.NET Application needs to send email periodically to internet users .. how to do this? ..
Thanks a lot in advance
Regards
Winanjaya
-
Nov 19th, 2003, 10:31 AM
#2
Hyperactive Member
Here is a sample I cut and pasted from one of my forms. Keep in mind that even though this is a windows form you still use the systems.web.mail to fire off the email.
VB Code:
Dim newMail As New System.Web.mail.MailMessage
newMail.Body = _
"This is a test email message from the new time " & _
"entry application. This function will be used in " & _
"the new T.E. App to announce when a payroll period " & _
"begins and ends." & vbCr & vbCr & "This announcement " & _
"is an automated message so please do not reply to it. " & _
"You can just ignore this message for now." & vbCr & vbCr & _
"Thank You," & vbCr & vbCr & "Signature Here"
newMail.Subject = "Start Payroll <---- Just ignore for now"
System.Web.Mail.SmtpMail.SmtpServer = "MailServerName"
System.Web.Mail.SmtpMail.Send(newMail)
Just change the To, the From and the mail server name to match your needs.
-
Nov 19th, 2003, 08:17 PM
#3
Thread Starter
Fanatic Member
Thanks but When I try to send though the local SMTP service on Win 2000 AS I get "Error!! Could not access 'CD).Message' object"
am I missing something?
TIA
Winanjaya
-
Nov 19th, 2003, 11:20 PM
#4
PowerPoster
Lets see the code you are using. There are limitations to using this method. First, IIS has to be installed. That is probably where you are getting an error.
The way I got around that when I was creating a project recently was to put the email functionality in a web service. The client app calls the web service passing in all the information, and the web service does the emailing. Something to look into if you are operating in a networked environment.
-
Mar 10th, 2004, 04:04 PM
#5
Lively Member
hellswraith,
I'm trying to do the same thing & receive the error message:
Could not access 'CDO.Message' object. I've added a reference to system.web & system.web.services to my project. I have IIS installed. The code I am runnign is exactally what Bukhix had posted before (with my server name changed along with the To & From addresses. I am on a networked environment and need to send these emails to outside customers. Thanks for any help you can offer.
Corinne
-
Mar 10th, 2004, 04:24 PM
#6
Hyperactive Member
Since you are on a local network and trying to send emails to outside domains you may be experiencing a problem with authentication.
You may want to check this thread for a possible solution:
Please help SMTP server authentication
Let me know if that takes care of the problem.
-
Mar 31st, 2004, 11:30 AM
#7
Addicted Member
smtp problem
Hi Bukhix,
I am referencing System.Web.Mail in my C#.net application
but there is a problem. It says
D:\Projects\Mailing\frmSendMail.cs(9): The type or namespace name 'Mail' does not exist in the class or amespace 'System.Web' (are you missing an assembly reference?)
Do I need to include anyother namespace?
What file (*.dll) should I reference in my project so that
the namespace is recognised?
thanks
there r no alternatives 4 hardwork.
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
|