|
-
Jul 26th, 2004, 07:04 AM
#1
Thread Starter
Fanatic Member
Send one email every 24 hours?
Hello,
I found this contest where you can enter once a day until via email until the contest is over. Out of laziness, It would be nice to have a small app that would send one email every 24 hours. There would only be one recipient with a subject line and my name, address, age, and phone number in the body.
Has anyone seen or done anything like this? I might be able to find some freeware on the net that will do it, but it would be more fun to write something. Any pointers in the right direction are appreciated.
Thanks!
-
Jul 26th, 2004, 05:38 PM
#2
Hyperactive Member
Re: Send one email every 24 hours?
Originally posted by birthjay
Has anyone seen or done anything like this? I might be able to find some freeware on the net that will do it, but it would be more fun to write something. Any pointers in the right direction are appreciated.
Thanks!
You can use:
System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
System.Web.Mail.SmtpMail.Send( _
"SenderAddress", "RecepientAddress", "SubjectText", "MessageText")
to send an email by SMTP. Add a timer could do what you want.
-
Jul 26th, 2004, 08:54 PM
#3
Frenzied Member
try creating a Windows Service and use a timer to check every second, when it reaches a certain time of day, start a new thread and mail your entry 
That's a more advanced solution but definately worth learning
-
Jul 26th, 2004, 09:37 PM
#4
Thread Starter
Fanatic Member
I found this, but am getting an error...
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim newMail As New System.Web.mail.MailMessage
newMail.To = "[email protected]"
newMail.From = "[email protected]"
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)
End Sub
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll
Additional information: Could not access 'CDO.Message' object.
-
Jul 26th, 2004, 10:00 PM
#5
Thread Starter
Fanatic Member
I found this article at Microsoft which seems to work, but because of the Outlook security, I get a message prompt that states..."A program is trying to send an email on your behalf." and then ask me if I want to permit it or not. Obviously, I do want to permit it. Does anyone know how to bypass this?
http://support.microsoft.com/?kbid=313803
-
Jul 26th, 2004, 11:35 PM
#6
Frenzied Member
CDO is the Collaboration Data Object found usually on machines with IIS or Exchange. Lot of people have had trouble with this error. I resorted to a 3rd party control.
You can install IIS on your machine but that's probably overkill if u just wanna send mail for a short period. that's my opinion anyway.
-
Jul 27th, 2004, 06:35 AM
#7
Thread Starter
Fanatic Member
Thanks all! I wound up using a macro in Outlook. To bypass, the Outlook security issue I used a free program at ContextMagic.com.
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
|