Problem in creating a Windows Service

Discussion in 'ASP .Net' started by =?Utf-8?B?S2F2aXRoYQ==?=, Jul 7, 2004.

  1. I am creating a windows service which sends email to some people at regular intervals.

    Shared Sub Main()
    Dim ServicesToRun As System.ServiceProcess.ServiceBase
    ServicesToRun = New System.ServiceProcess.ServiceBase(){New MailService()}
    End Sub

    In Timer Elapsed Event:
    ---------------------------------------------
    Dim Mailmsg As New MailMessage()
    With Mailmsg
    .From =
    .To =
    .Subject = "Check Printer Status"
    End With
    SmtpMail.SmtpServer="127.0.0.1"
    SmtpMail.Send(Mailmsg)
    ---------------------------------------------
    When I build and run the application, it is firing an error. No mail is going out. Can anyone please solve this solution.
    --
    Kavitha
    =?Utf-8?B?S2F2aXRoYQ==?=, Jul 7, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?S2F2aXRoYQ==?=

    Thomas Dodds Guest

    Vinay: Citigroup.Com - "Thanks for visiting us at Careers at Citigroup! We are always looking for talented people to join our team ..."

    Kavitha: you still having issues? I'll be glad to help you ... post your error


    "vinay" <> wrote in message news:...
    > Hey Kavita
    >
    > I need to create a Windows service for Email
    >
    > Please send the code if possible..
    >
    >
    >
    > Thanks
    > vinay
    >
    > "Kavitha" wrote:
    >
    >> I am creating a windows service which sends email to some people at regular intervals.
    >>
    >> Shared Sub Main()
    >> Dim ServicesToRun As System.ServiceProcess.ServiceBase
    >> ServicesToRun = New System.ServiceProcess.ServiceBase(){New MailService()}
    >> End Sub
    >>
    >> In Timer Elapsed Event:
    >> ---------------------------------------------
    >> Dim Mailmsg As New MailMessage()
    >> With Mailmsg
    >> .From =
    >> .To =
    >> .Subject = "Check Printer Status"
    >> End With
    >> SmtpMail.SmtpServer="127.0.0.1"
    >> SmtpMail.Send(Mailmsg)
    >> ---------------------------------------------
    >> When I build and run the application, it is firing an error. No mail is going out. Can anyone please solve this solution.
    >> --
    >> Kavitha
    Thomas Dodds, Aug 31, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?S2F2aXRoYQ==?=

    Rutger Smit Guest

    vinay wrote:

    > Hey Thomas
    >
    > I created the service for email.
    > Now, how do i install it on the Server??
    >
    > Do i need to copy the whole project to the server??
    >
    > Thanks
    > vinay
    >
    >
    > "Thomas Dodds" wrote:
    >
    >



    unstallutil.exe does it, check out this page
    http://www.aspnl.com/aspnl/nl/artikelen/windowsservice.asp (in Dutch, ha!)


    Go to the VS.NET command prompt (Start > Programs > Microsoft Visual
    Studio .NET > Visual Studio .NET Tools > Visual Studio .NET Command Prompt)

    Typ on the commandline this statement: installutil
    D:\Path\To\Executable\SchedulePlus.exe

    Uninstalling: do the same but add the switch /u (but don't forget to
    stop the service first)

    //Rutger
    Rutger Smit, Sep 1, 2004
    #3
  4. =?Utf-8?B?S2F2aXRoYQ==?=

    Rutger Smit Guest

    vinay wrote:

    > Smit
    >
    > I am able to run the service locally which i installed using installutil
    > command.
    >
    > My Q is, now i have to implement the same on the Server.
    > To install on the server, do i have to move the whole project or just the
    > EXE file???
    >
    > Thanks
    > vinay
    >
    > "Rutger Smit" wrote:
    >
    >


    The executable will be enough if you do not use custom libraries (dll's)
    or other stuff.

    //Rutger
    Rutger Smit, Sep 1, 2004
    #4
  5. =?Utf-8?B?S2F2aXRoYQ==?=

    Rutger Smit Guest

    vinay wrote:

    > I have one Dll added to the references Interop.aspSmartMail.dll
    >
    > So do i have to move this dll too??
    >
    > "Rutger Smit" wrote:
    >
    >
    >>vinay wrote:
    >>
    >>
    >>
    >>The executable will be enough if you do not use custom libraries (dll's)
    >>or other stuff.
    >>
    >>//Rutger
    >>



    Yes you have to.

    But if you are uncertain about it, why not try to run it on a testserver
    first without the dll and see what happens. A good test by the way.

    If you only made a refeence but you don't use it's functionality the you
    don't have to upload it to the server. I guess you understand that?

    //Rutger
    Rutger Smit, Sep 1, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. teluksridhar

    Creating Windows service using C++ in non-CLR env

    teluksridhar, Nov 6, 2006, in forum: C Programming
    Replies:
    0
    Views:
    3,455
    teluksridhar
    Nov 6, 2006
  2. jobs
    Replies:
    1
    Views:
    599
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 25, 2006
  3. Bert Leu
    Replies:
    1
    Views:
    449
    Cowboy \(Gregory A. Beamer\)
    Nov 23, 2007
  4. Bert Leu

    Creating a Web Service (Service, not Client) from WSDL

    Bert Leu, Nov 23, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    263
    Cowboy \(Gregory A. Beamer\)
    Nov 23, 2007
  5. Rajiv Abraham
    Replies:
    3
    Views:
    287
    Rajiv Abraham
    Apr 16, 2010
Loading...

Share This Page