How do I work With localhost for emailing

Discussion in 'ASP.NET / ASP.NET Core' started by jesha, Aug 25, 2009.

  1. Hello.

    we have some application in which on the sumbmossion of some data we generate some email to a perticular employee..
    say like...for example..
    we have a Timesheet, and when any employee submit their Timesheet,
    we generate an email to his/her supervisor saying "New Timesheet is submitted" ,for that...I was using this code..

    For Mail To Supervisor : -

    Dim mail2 As New System.Net.Mail.MailMessage(Mysession.LoginEmail, EEmail)
    With mail2
    .Body = Msg.ToString
    .Priority = System.Net.Mail.MailPriority.High
    .Subject = "New TimeSheet Notification"
    .IsBodyHtml = True
    End With
    Dim mailseS As New System.Net.Mail.SmtpClient("mail.mycompany.com")
    Dim asbS As String = mailseS.Host()
    mailseS.Send(mail2)

    I was using SMTP server as my company's emailing host.
    and it was working perfectly.
    but since few days back god knows..It stopped working.and now no mail has been issuing.

    Can anyone guide me what to do ??
    Some1 suggest me to do this with localhost....i don't know how to do with that..
    any help will be appreciated.



    Thanks,
    Jesha
     
  2. mjp

    mjp

    Try changing:

    Dim mailseS As New System.Net.Mail.SmtpClient("mail.mycompany.com")

    to:

    Dim mailseS As New System.Net.Mail.SmtpClient("localhost")
     
  3. Thanks mjp,

    it worked for me.


    Jesha
     
  4. mjp

    mjp

    Cool, glad it's working for you.
     

Share This Page