Sending Email
-
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
-
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
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 ofusing System.Web.Mail;
useusing 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. -
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 ofusing System.Web.Mail;
useusing 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.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
-
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
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. -
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.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