How to configure mail for local network and send mail through asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • premMS143
    New Member
    • Nov 2008
    • 75

    How to configure mail for local network and send mail through asp.net

    Hi to all,
    We at Our company having our own local network in which consists around 20 users. We do not have Internet connections.
    Now I've created an asp.net website to share the data among the different users.
    Now I'm thinking that it would be better if we have an mailing facility. Please guide me how we can establish to send mail each other.
    How to create unique mail ids for each user.


    Reply is highly appreciated.

    ThanQ
    Prem
  • krisviswa
    New Member
    • Mar 2010
    • 6

    #2
    Dear Prem

    First of all you have to configure your smtp server.
    from asp.net point of view I am giving hereunder the vb.net code which will send the mail to your team members.
    Code:
    Imports System.Net.Mail
    
    Dim message As New MailMessage
                        message.From = New MailAddress("YourMailId@Mail.com", "Hi"
                        message.To.Add(New MailAddress(mailid))
                        message.Subject = "Your Account"
                        message.IsBodyHtml = True
                        Dim br As New HtmlGenericControl("<br>")
                        message.Body = "Your Mail text"
    
     Dim client As New SmtpClient
    client.Send(message)
    Its working for me and hope you do not struggle more

    kris
    Last edited by Frinavale; Mar 25 '10, 04:42 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Check out this quick reference on how to send an email in .NET.

      -Frinny

      Comment

      Working...