Results 1 to 7 of 7

Thread: Send one email every 24 hours?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    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!

  2. #2
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    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.



  3. #3
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    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

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830
    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.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830
    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

  6. #6
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    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.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830
    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
  •  



Click Here to Expand Forum to Full Width