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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sending Email

Sending Email

Scheduled Pinned Locked Moved ASP.NET
databasealgorithmshelp
5 Posts 3 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
    kirthikirthi
    wrote on last edited by
    #1

    Hi Can any one tell this 1. I am searching the mail address in database "select email from events where date = '2/18/2006'" 2. I want to send a remainder mail to all the search people Help me Code Explain : I am working on a "Month Events" Application I need to send Mails(On the day) who ever Write thair reminder in the list(database) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 5:45 Saturday 18th February, 2006

    M N 2 Replies Last reply
    0
    • K kirthikirthi

      Hi Can any one tell this 1. I am searching the mail address in database "select email from events where date = '2/18/2006'" 2. I want to send a remainder mail to all the search people Help me Code Explain : I am working on a "Month Events" Application I need to send Mails(On the day) who ever Write thair reminder in the list(database) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 5:45 Saturday 18th February, 2006

      M Offline
      M Offline
      Mircea Grelus
      wrote on last edited by
      #2

      Include using System.Web.Mail; MailMessage mailMsg = new MailMessage(); mailMsg.To = txtTo.Text; mailMsg.From = txtFrom.Text; mailMsg.Cc = txtCc.Text; mailMsg.Subject = "Test Email"; mailMsg.Body = txtName.Text + ", " + txtComments.Text; mailMsg.Priority = MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { SmtpMail.Send(mailMsg); Response.Write("Email sent"); } catch (Exception exc){ Response.Write("Send failure: " + exc.ToString()); }
      If you're using VS2005 instead of using System.Web.Mail; use using System.Net.Mail because the first is obsolete in VS2005. read this article[^] for more details regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

      K 1 Reply Last reply
      0
      • M Mircea Grelus

        Include using System.Web.Mail; MailMessage mailMsg = new MailMessage(); mailMsg.To = txtTo.Text; mailMsg.From = txtFrom.Text; mailMsg.Cc = txtCc.Text; mailMsg.Subject = "Test Email"; mailMsg.Body = txtName.Text + ", " + txtComments.Text; mailMsg.Priority = MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { SmtpMail.Send(mailMsg); Response.Write("Email sent"); } catch (Exception exc){ Response.Write("Send failure: " + exc.ToString()); }
        If you're using VS2005 instead of using System.Web.Mail; use using System.Net.Mail because the first is obsolete in VS2005. read this article[^] for more details regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

        K Offline
        K Offline
        kirthikirthi
        wrote on last edited by
        #3

        I can send mail But When i retrive MAILID's list from database How can i send them Example : I retrive -------------- "SELECT EMAIL FROM EVENTS WHERE DATE = '12/2/2006'" If i got 4 mailIds OR 5 MailIds How can i write the code to send the mail How to send No.of Mails At a time.......... asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 6:51 Saturday 18th February, 2006

        1 Reply Last reply
        0
        • K kirthikirthi

          Hi Can any one tell this 1. I am searching the mail address in database "select email from events where date = '2/18/2006'" 2. I want to send a remainder mail to all the search people Help me Code Explain : I am working on a "Month Events" Application I need to send Mails(On the day) who ever Write thair reminder in the list(database) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 5:45 Saturday 18th February, 2006

          N Offline
          N Offline
          Nadeem Akhter
          wrote on last edited by
          #4

          Dear Kirthikirthi, first of all you have to store all e-mail address into string. then u will set the e-mail to = string. Dim SQL As String Dim st As Integer dim email as string SQL = "SELECT Email FROM Users where date ='18-02-2006' Dt2 = Objdb.ReturnDataTable(SQL) email = "" ' For Check the Users who want to news letter If Dt2.Rows.Count > 1 Then For st = 0 To Dt2.Rows.Count - 1 If st <> 0 Then email = email & ";" + Dt2.Rows(st).Item(0) Else email = Dt2.Rows(st).Item(0) End If Next Else If Dt2.Rows.Count = 1 Then email = Dt2.Rows(0).Item(0) End If End If in send mail in to field just pass the email string... Rgds, Muhammad Nadeem.

          K 1 Reply Last reply
          0
          • N Nadeem Akhter

            Dear Kirthikirthi, first of all you have to store all e-mail address into string. then u will set the e-mail to = string. Dim SQL As String Dim st As Integer dim email as string SQL = "SELECT Email FROM Users where date ='18-02-2006' Dt2 = Objdb.ReturnDataTable(SQL) email = "" ' For Check the Users who want to news letter If Dt2.Rows.Count > 1 Then For st = 0 To Dt2.Rows.Count - 1 If st <> 0 Then email = email & ";" + Dt2.Rows(st).Item(0) Else email = Dt2.Rows(st).Item(0) End If Next Else If Dt2.Rows.Count = 1 Then email = Dt2.Rows(0).Item(0) End If End If in send mail in to field just pass the email string... Rgds, Muhammad Nadeem.

            K Offline
            K Offline
            kirthikirthi
            wrote on last edited by
            #5

            Hi sir.. What is = Dt2 = Objdb.ReturnDataTable(SQL) I am using OLEDB Can u Please give me U r code Example with OLEDB connection I try but it giving some error........... MY CODE IS : Dim da As Date da = Calendar1.TodaysDate Dim st As Integer Dim email As String Dim dt2 As DataTable Dim dsn, com As String dsn = "server=DDD;uid=ui;pwd=sa;database=Northwind" com = "select email from Events Where date = '" & da.ToString & "' " Dim connection As New SqlConnection(dsn) Dim command As New SqlDataAdapter(com, connection) dt2 = com.ReturnDataTable(com) email = "" ' For Check the Users who want to news letter If dt2.Rows.Count > 1 Then For st = 0 To dt2.Rows.Count - 1 If st <> 0 Then email = email & ";" + dt2.Rows(st).Item(0) Else email = dt2.Rows(st).Item(0) End If Next Else If dt2.Rows.Count = 1 Then email = dt2.Rows(0).Item(0) End If End If But It giving error Here ---> Dt2 = Oledb.ReturnDataTable(com) Dt2 ? ReturnDataTable ? ThankYou asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 23:39 Sunday 19th February, 2006

            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