Email With Content From Database?

Apr 2, 2010

I've setup my app to send an email on a button click. My code as below for when the button is clicked:

MailMessage email = new MailMessage();
email.To.Add(TextBoxTo.Text);
email.Subject = TextBoxSubject.Text;
email.Body = TextBoxBody.Text;
SmtpClient smtp = new SmtpClient();
try {
smtp.Send(email);
} catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}

I'd like to be able to select some information from my database and store this in some kind of table and include this in the body of the e-mail. I know I can set the body to be html so how would I select information from my database and store in possibly a html table?

View 12 Replies


Similar Messages:

How To Email All Div Content

Mar 19, 2010

I need to email all my Div content which include label, image, Repeater control. I have email template in Database. so i need to replace the string in template with the Div tage. so that i can send mail with required details.

Problem is images are not visible in the email.

View 2 Replies

Getting Email Content To DB?

Dec 3, 2010

I have a website with CRM and the admin can send messages that will get to the client page and to the email

our client have email address in our server (mail-enable program)

if his user will decide to reply for the email we will loose his reply from the system. is it possible to get the content of an email to DB?

View 1 Replies

Email To Include Content Of TextBox?

Mar 24, 2011

I have written a Web Page which allows Club members to send a message to Committee Members. The Input Page is a Details View which allows input of the Members name, Email Address and a text message - this is stored in a SQL Table.

Currently the Page then sends an email to Committee Members which advises that there is a message on the website. The Committee then have to log on and access the Message page to read the message.

I would like to include in the email the content of TextBoxes from the Details View.

The Code I am currently using for sending the email is below

Imports System.Net.Mail
Partial Class NonAdmin_ContactUs
Inherits System.Web.UI.Page
Protected Sub ContactUs_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles ContactUs.ItemInserting
e.Values("Date") = DateTime.Now
Dim textSubject As String = "New Message"
Dim textBody As String = "There is a new Message on the Malling Photographic Society Website. Please advise the rest of the Committee if you are handling this message"
Dim mailMessage As New System.Net.Mail.MailMessage
Dim MailClient As SmtpClient = New SmtpClient
mailMessage.From = New MailAddress("jpoll@sky.com")
mailMessage.To.Add(New MailAddress("committee@yahoogroups.co.uk"))
mailMessage.Subject = textSubject
mailMessage.Body = textBody
MailClient.Send(mailMessage)
End Sub
End Class

View 7 Replies

Web Forms :: How To Attach Div Content As PDF In Email

Aug 26, 2010

I need to send table information as PDF file as attachment. how do i convert Div conntent into PDF. i got many link but i was unable to convert only my Div content not HTML page. is there any way to do this.

View 1 Replies

C# - Sending A DataTable's Content In Html Email?

May 14, 2010

Sending a DataTable's content in an html email, what is the preferred way to generate HTML from a DataTable?

View 3 Replies

Dynamic Email Addresses And Message Content

Apr 11, 2010

I have managed to send emails with a button click to whomever i specify and whatever content i specify from my website. is there anyway i can make the email and content of the messages dynamic, and make the emails automatic?? on a date (from my database) i would like it to email a certain user some templated message: Congratulations "name", you have won "money" or something like that? Basically on a datetime, pull certain information from the database relating to the one user i am emailing, and send it automatically?

View 2 Replies

Web Forms :: Share Image And Table Content In Email

Apr 27, 2016

I need a code to share a patients records in image and table content in e-mail among doctors group.

View 1 Replies

Data Controls :: Send Email With Data From Database In Email Body?

May 7, 2015

how to send email with database contents?

View 1 Replies

Updating SQl Database Via Email?

Mar 31, 2011

Depending upon some condition I want to send the mail to the xyz user which will have two links "Accept" and "Reject" in the message body. When the recepient clicks either of the link an update/insert should be performed in the database against a particular record. For this , when I will be sending the mail, I will be requiring to send some unique Id along with the mail depending upon which I will be able to decide which record to update in the database. I am using SQl Server 2008 and C#.net. Does any one know how to implement it in VS 2008.

View 2 Replies

C# - Email Sent Through Outlook Should Update Database

Sep 10, 2010

We have to build a small grievance report system. In this users enters their grievance on a ASP.Net page. An email is sent to particular individual of a department. When this individual opens this email in outlook and responds a field in a SQL server table needs to be updated. How to accomplish this SQL Server update?

Platform : .Net
Preferred language : C#
Database : SQL Server
Email client : Outlook

View 2 Replies

How To Get Values From An Email Body And Into A Database

Feb 22, 2011

What's the easiest method of getting values from an email body and inserting them into a database?

I am able to connect to a POP3 account and read new emails, but I don't know how to 'process' the email content. The email is in plain text format, and the content is like:

test name: 1
another test: No
some other test: 54
final test:

View 4 Replies

Send Email And Save To Database?

Feb 16, 2011

I have a form that sends an email when the submit button is clicked. The email functionality works great. I also need it to save the information to the Database. I have attempted to get it to work but it gets hung at a certain point when trying to write to the DB. Even when the DB error happens, the email is still sent. I have attached the code that I am using as well as the error that I am getting.

I am using MS SQL 2005 and VB in my code behind.

View 8 Replies

Web Forms :: Can Load A Ddl With Content From A Database

Dec 6, 2010

I have a database table a field that is the 5 character cultureinfo code. I would like to create a dropdown control that has its value set from the database field (the database table contains only a list of those languages supported by the site) but displays the cultureinfo name.

View 1 Replies

C# - Saving HTML Content To Database?

Mar 16, 2011

how to accomplish saving div+contents/layout to a database and then retrieveing that data to post back.

View 1 Replies

Send Email To All User Id Stored In Database?

May 12, 2010

I have above 50 user email id stored in my database i want to send email, As a admin, I typed some message, when i press send button. It will send to to all user email Id which is stored in My Database. I am using asp.net and c#.

View 6 Replies

Send Email When Submit A New Request Into The Database?

Feb 8, 2010

how to send email when you submit a new request into the database.

View 6 Replies

How To Update A Database Record By Replying An Email

May 11, 2010

I have seen that when some one posts a message on my facebook wall, I get a mail and I can reply to that wall post by just replying that email and my wall gets updated. I want to implement this feature in an ASP.Net website of mine but don't know how can I accomplish this task.

View 10 Replies

ADO.NET :: C# Grab Data From Database To Send Email?

Dec 9, 2010

I'm doing a project where I need to send email.

But i need to grab the name and email address from the database to send email.

How do I grab the particulars from the database?

View 3 Replies

DataSource Controls :: Email Xml Attachment To Database?

Jan 14, 2010

I want to Read an email xml attachments validate the xml with scheme then to write to database the xml data

and oppse to read from database and write to xml (also to validate with scheme) and send the xml by email

what is the best way to do that

example

to read from database to datatable then using datatable.writeXml .....

the best way to validate the xml with it's scheme

the best way to build scheme for xml file.

View 1 Replies

Web Forms :: Sending An Email And Updating A Database?

Mar 25, 2011

I have a formview to insert data into a DB. Works great... I would also like to send an email after the user submits the form. I put the mail message code on the .cs page and it worked great!!!! Except it did not update the DB.......I really need it to do both......... but one or the other works fine

View 4 Replies

AJAX :: How To Save The Content In The HtmlEditor Into Database

Mar 3, 2010

[Code]....

I want to save the content in the HtmlEditor into database, I think I can't put "Editor1" as the parameter name of the UpdateParameters, so maybe I can use OnContentChanged for the HtmlEditor to save the content into Label "Settings2" and put "Settings2" as the Parameter Name. Something like:

[Code]...

View 5 Replies

Sending Notice To Users On Database New Content?

Mar 16, 2010

I have been developing a job tracking system in asp.net VB I have used the users/roles system for user access each role has their own area within the system

Admin
User
Design
Translations

After a user logs in to the system they can create a new job, after a job has been created I would like a notice sent to the admins (new job in system) with the job id or name etc, on the form for the job I would like to have a radio box accept reject if the job is accepted it will send and email / notice to the design team to say their is a new job and another notice/email to the user to say the job has been started I have configured email in my web.config file for retriving forgotten passwords, I have not done anything with messaging or email before and I only have a month to impliment this if it is possible at all

View 5 Replies

Architecture :: Multi Language Database Content?

Jan 27, 2011

The content of the web site I am creating is expected to store data for multiple languages. What I mean by the content is the actual data stored in the database (SQL Server 2008 R2). For example I have a database table to store available packages and one of the columns in this table is the description which is shown on the web site. This description should be stored in multiple languages for example (en, fr, de). What is the best way(s) to get this done, I can of course have the same table with multiple columns (each column representing a single language) and code the data access layer to load the proper column based on the current language, but is there an easier way? An ideal situation is where like in ASP.NET the database automatically detects the current language and return the proper column

View 6 Replies

C# - Page Content In Database Vs File Performance?

Sep 29, 2010

I am creating a site whose content is dynamic and has images in it.How much performance hit will my DB (MSSQL) take if I save content/Images in DB?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved