Data Controls :: Send Email With Data From Database In Email Body?
May 7, 2015how to send email with database contents?
View 1 Replieshow to send email with database contents?
View 1 RepliesI am new to ASP.NET and have made a register page, 'get' which on submitting redirects to another page 'pick1' displaying the data in Gridview. In each row of the Gridview there are 'View' buttons which on clicking opens a pop-up page having 2 buttons 'send mail' and 'cancel'. On clicking 'send Mail' button, i want selected row of data to be sent by email instead of the entire gridview. Right now only the entire gridview data is coming to my mail. Also i want to attach a link to the email so that it redirects to the 'pick1' page again on clicking in email. How can I do it?
Below is my code for 'pick1' page:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.BindData();
[Code] ....
And the image of my 'pick1' and 'popup' page:
I followed this link, it works fine with English Text. [URL] ....
My problem is when I am adding Arabic text to the message body it displays ???? format.
how to display Chart in Email body and excel attachment.
View 1 RepliesI have been trying to add BLOB Image from Oracle Database table to Email content as HTML table elemnt.
<table style='width: 100%; font-weight: bold;'>
<tr style="border-style: groove; font-size: 14px; font-weight: bold; background-color: #45a297;">
<td colspan="2" style="font-size: 8px; font-family: Verdana; font-weight: bold; padding-left: 0px; color: white; font-size: 16px; text-align: center">Flight</td>
</tr>
[CODE]..
I am getting my data in Email except Image in mail content.
Am using ur code for sending email asp chart ,
but image not showing properly
I am trying to send email using gmail smtp. I used to bind the grid view to mail body using GridViewToHtml(GridView1) this method. I defined the method in same source file as ...
View 1 RepliesI have 3 procedures.
1. SP_General - Gives the output with 3 columns like: ID NAME DOB with multiple rows
2. SP_HTML - Gives the HTML formatted output like: <table><tr><td>ID</td><td>NAME</td><td>DOB</td></tr></table>
3. SP_Email - Sends email (written by using extended stored procedures). Input parameters: Body, etc
When I DO:
1. EXEC SP_Email @Body = 'Hello this is testing'. I recieve the email saying: Hello this is testing
2. EXEC @Results = SP_General
EXEC SP_Email @Body = @Results. I recieve the email saying: 0
3. SELECT @Results = EXEC SP_HTML
EXEC SP_Email @Body = @Results. I recieve the email saying: 0
4. SELECT @Results = '<table><tr><td>ID</td><td>NAME</td><td>DOB</td></tr></table>' (If hardcoded like this)
EXEC SP_Email @Body = @Results. I recieve the email with correct output in a nice formatted table: ID NAME DOB
Its working in 1 and 4 cases but not 2 and 3. As I cannot hardcode like that, can anyone tell me where I'm doing mistake in 2 or 3 cases?
protected void send_mail()
{
String genpass;
genpass = GeneratePassword();
lblResult.Text = genpass.ToString();
string mail_id = "xtream.hell97@gmail.com";
string mail_password = "XXXXXXX";
[Code] ....
I want to send this email in formated html with logo. So i want to chane only its body part with html page to send users auto generated password.
I have added an image while sending mail but it didn't displayed at all when i have opened the mail...
View 1 RepliesI'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?
I am creating a nightly process using a stored procedure to check for expiring records and emailing myself and the folks that need to see the information. The trouble I am having is trying to send the data in table "like" view in the message body.Here is the Proc you can see the point at which i try to use a table vairble then use it as a parameter for calling the email proc but it doesn't seem to work.
View 5 Repliesi have done sending gridview data as excel to mail, it is working fine
then i had 5 columns in gridview but i want to send 4 column instead of 5 column.
protected void Button1_Click(object sender, EventArgs e)
{
fn_AttachGrid(); // here calling function to send mail gridview data as excel format
}
[Code]....
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:
What's the best way to go from a dataset to the body of an email?
I have a .net console app to send email notification based on results of a stored proc and wanted to know how best to go from SQL data to Email body?
html body with colors and fonts would be best but plain text is also fine.
When you click on a button my program have to send a email where a report must be generated from table adapters from dataset. Now this report is not going to be displayed when the button is clicked, so it will be sent automatically by code which I have some part(see below). My questions are:
1. how can you generate or build a report without displaying it.
2.embeed this report or data collection from the table adapters as part of the body of the email
my email code so far is this:
mail.From = New MailAddress("qwerty@[URL]")
mail.To.Add(New MailAddress("qwerty@[URL]"))
mail.Subject = "test"
mail.Priority = MailPriority.Normal
Dim smpt As New SmtpClient
smpt.Host = [URL]
smpt.Port = 25
smpt.Credentials = New System.Net.NetworkCredential("qwerty@[URL]","****")) 'hehe not telling :P smpt.EnableSsl = True................
iam using asp.net2.0 with c#
in my gridview 1st column is checkbox control in template fileds and iam using paging also. when user clicks the button ,all selected no of check boxes data has to be send in mail
In Visual Studio 2008 I am using an asp.net 3.5 listview control as my frontend to an sql server 2005 database backend. I am also using a linq to sql datacontext to query and perform all my backend CRUD commands. Within the OnInserted event of my linqdatasource I am assigning a query string variable (customer_id) to populate a child page (code below). This works perfectly. However, what I would also like to achieve within this event is to build an email body containing other database column references, from my insert, that will send an email to all the email addresses contained within a seperate column from another one of my db tables. Any ideas on how I can achieve this? C# code examples will be appreciated.
View 4 RepliesIm trying to send an email from a web page and have found many examples. My problem is that I cant see the SmtpMail Class. Im using VS 2008. Heres the code:-
[Code]....
unyet I have added the System.Net.Mail namespace. Heres the error message:- Error 1 The name 'SmtpMail' does not exist in the current context C:DocumentsVisual Studio 2008ProjectsWeb ApplicationsASPEmailEmailDefault.aspx.cs 29 13 Email.
i have a gridview on a page.
how can i create a button which sends the gridviews results to someone by email?
How can I send the rich text mail to several recepients?
protected void SendEmail(object sender, EventArgs e)
{
string body = this.PopulateBody("John",
"Fetch multiple values as Key Value pair in ASP.Net AJAX AutoCompleteExtender",
"http://www.posta.ge" +
"in-ASP.Net-AJAX-AutoCompleteExtender.aspx",
"Here explained how to fetch multiple column values i.e." +
" ID and Text values in the ASP.Net AJAX Control Toolkit AutocompleteExtender"
+ "and also how to fetch the select text and value server side on postback");
this.SendHtmlFormattedEmail("johndoe@posta.ge", "New article published!", body);
}
With this code i can send to only one recipient, namely to johndoe@posta.ge. Say i want to add kitsi@posta.ge as well.
In datagridview records as follows
Name Email Message
Ram ram57@gmail.com Tomorrow meeting at office 10 AM
Arun arun86@gmail.com Tomorrow work to be finished at right time
Vijay vijay76@gmailcom Client meeting at 11 AM
i have one button called Sendmail,when i click that sendmail Button i want to send the mail.
for that how can i do using c#.
Note it is windows application.
On my matrimony test web site I want to send the matched profiles into members email. Basically, when user searches anything it displays in ListView with photo, Name, Age etc. In the same format I want to send it....how to do this...
View 1 Repliesiam using asp.net with c# iam sending gridview data in a mail ,but when gridview having many records in pages then, only first page is send in email and other pages are not send , can you correct my code how to send all data in a mail
[Code]....
as u can see from below aspx code i need values of row of the gridview
1)My gridview last column contains dropdownlist.it contains two values (qualified/disqualifed).on selecting qualified or disqaulified i need to get all the values of the row of gridview....
2)after getting all the values i need to send those values to email...the email should be send to the particular email id of email column,
For eg-if i select 1st row from gridview.and in that 1st row if i select ist dropdownlist(either qualified/disqualified).after selecting qualified/disqualified from dropdownlist i need to get all the values of the first row..and i need to send all the values of the first row of gridviews through email to the emai id of first row.....
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px"
CellPadding="4" CellSpacing="2" ForeColor="Black" Height="122px"
Width="495px" onrowdatabound="GridView1_RowDataBound">
<FooterStyle BackColor="#CCCCCC" />
<RowStyle BackColor="White" />
[code]...