Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Auto send Emails

Auto send Emails

Scheduled Pinned Locked Moved ASP.NET
help
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kavitha_blueindia
    wrote on last edited by
    #1

    Hi all, I need to auto send email when some posted a new ticket/event in my project.Please help me to achieve. Thanks a lot.

    A C 2 Replies Last reply
    0
    • K kavitha_blueindia

      Hi all, I need to auto send email when some posted a new ticket/event in my project.Please help me to achieve. Thanks a lot.

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      kavitha_blueindia wrote:

      I need to auto send email when some posted a new ticket/event in my project.

      If you need to send it on a event then just write code for send mail on that event. or you want something else .

      cheers, Abhijit

      T 1 Reply Last reply
      0
      • A Abhijit Jana

        kavitha_blueindia wrote:

        I need to auto send email when some posted a new ticket/event in my project.

        If you need to send it on a event then just write code for send mail on that event. or you want something else .

        cheers, Abhijit

        T Offline
        T Offline
        Tamer Oz
        wrote on last edited by
        #3

        You can use the method below. C# public void SendMail(string smtpAddress, string from,string to, string cc, string bcc, string body, string subject, bool isHtml,string attachmentFileNames) { SmtpClient insSmtpClient = new SmtpClient(smtpAddress); MailMessage insMailMessage = new MailMessage(); insMailMessage.From = new MailAddress(from); foreach (string strBcc in bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.Bcc.Add(strBcc); } foreach (string strTo in to.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.To.Add(strTo); } foreach (string strCc in cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.CC.Add(strCc); } insMailMessage.Body = body; insMailMessage.Subject = subject; insMailMessage.IsBodyHtml = isHtml; foreach (string strAtt in attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.Attachments.Add(new Attachment(strAtt)); } insSmtpClient.Send(insMailMessage); } Kopyala -------------------------------------------------------------------------------- VB.Net Public Sub SendMail(ByVal smtpAddress As String, ByVal from As String, ByVal [to] As String, ByVal cc As String, ByVal bcc As String, ByVal body As String, _ ByVal subject As String, ByVal isHtml As Boolean, ByVal attachmentFileNames As String) Dim insSmtpClient As New SmtpClient(smtpAddress) Dim insMailMessage As New MailMessage() insMailMessage.From = New MailAddress(from) For Each strBcc As String In bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) insMailMessage.Bcc.Add(strBcc) Next For Each strTo As String In [to].Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) insMailMessage.[To].Add(strTo) Next For Each strCc As String In cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) insMailMessage.CC.Add(strCc) Next insMailMessage.Body = body insMailMessage.Subject = subject insMailMessage.IsBodyHtml = isHtml For Each strAtt As String In atta

        A 1 Reply Last reply
        0
        • T Tamer Oz

          You can use the method below. C# public void SendMail(string smtpAddress, string from,string to, string cc, string bcc, string body, string subject, bool isHtml,string attachmentFileNames) { SmtpClient insSmtpClient = new SmtpClient(smtpAddress); MailMessage insMailMessage = new MailMessage(); insMailMessage.From = new MailAddress(from); foreach (string strBcc in bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.Bcc.Add(strBcc); } foreach (string strTo in to.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.To.Add(strTo); } foreach (string strCc in cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.CC.Add(strCc); } insMailMessage.Body = body; insMailMessage.Subject = subject; insMailMessage.IsBodyHtml = isHtml; foreach (string strAtt in attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) { insMailMessage.Attachments.Add(new Attachment(strAtt)); } insSmtpClient.Send(insMailMessage); } Kopyala -------------------------------------------------------------------------------- VB.Net Public Sub SendMail(ByVal smtpAddress As String, ByVal from As String, ByVal [to] As String, ByVal cc As String, ByVal bcc As String, ByVal body As String, _ ByVal subject As String, ByVal isHtml As Boolean, ByVal attachmentFileNames As String) Dim insSmtpClient As New SmtpClient(smtpAddress) Dim insMailMessage As New MailMessage() insMailMessage.From = New MailAddress(from) For Each strBcc As String In bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) insMailMessage.Bcc.Add(strBcc) Next For Each strTo As String In [to].Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) insMailMessage.[To].Add(strTo) Next For Each strCc As String In cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) insMailMessage.CC.Add(strCc) Next insMailMessage.Body = body insMailMessage.Subject = subject insMailMessage.IsBodyHtml = isHtml For Each strAtt As String In atta

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          This is not the requirement. Main requirements is to send mail automatically with in a event.

          cheers, Abhijit

          E 1 Reply Last reply
          0
          • A Abhijit Jana

            This is not the requirement. Main requirements is to send mail automatically with in a event.

            cheers, Abhijit

            E Offline
            E Offline
            ednrg
            wrote on last edited by
            #5

            Actually, it is relevant, why wouldn't you just place that method call inside of the event being triggered?

            1 Reply Last reply
            0
            • K kavitha_blueindia

              Hi all, I need to auto send email when some posted a new ticket/event in my project.Please help me to achieve. Thanks a lot.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              I wrote an article on how to use google, I used sending emails as my example because 1 - it's SO easy to do 2 - there's SO much info on google about it and 3 - there's still SO many people too stupid to work it out. It's on this site, you should read it.

              Christian Graus Driven to the arms of OSX by Vista.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups