Web Services email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcatubay
    New Member
    • Mar 2007
    • 12

    Web Services email

    I have a windows services that sends an email, my problem is it will only send the email when the service is terminated or onStop. What can I do to send the email every time smtp.send is called and not wait till the service is terminated?
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Welcome to the site. Please provide more information.

    Comment

    • jcatubay
      New Member
      • Mar 2007
      • 12

      #3
      Originally posted by kenobewan
      Welcome to the site. Please provide more information.
      I have this code in my onStart() method:
      SmtpClient smtp = new SmtpClient("smt p.xxx.com");
      try
      {
      smtp.Send(messa ge);
      }
      catch (SmtpException a)
      {
      System.Console. WriteLine(a);
      }
      But for some reason the email is only sent out when the windows service is stopped. Does the message goes to a que and only sent when stopped? How can I make this send email in time intervals? Thanks!

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Does sound like its queing. How long do you have the application open? If you close the application after 5 mins does it send the email then?

        Comment

        Working...