473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

sending mails from asp.net pages

hi every one,
plz help me out, i have to send mails from my asp.net page.... I have tried a code where mails are going only to gmail users

the code is ...

namespace:
using System.Web.Mail;

protected void btnSend_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.To = txtTo.Text;
msg.From = txtFrom.Text;
msg.Cc = txtcc.Text;
msg.Bcc = txtbcc.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtContent.Value;
lblStatus.Text = "Sending...";
SmtpMail.Send(msg);
lblStatus.Text = "Email sent (" + txtSubject.Text + ") to " + txtTo.Text;
}

any thing wrong, plz help me and i also want to put attachment files, try to give code for file attachments in sending mails....

thanking you
Jul 19 '07 #1
2 1362
kenobewan
4,871 Expert 4TB
Try searching TSDN, there are many posts on sending emails.
Jul 19 '07 #2
Plater
7,872 Expert 4TB
We even have an article!
Jul 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Cpt. Zeep | last post by:
I'm writing small script for sending mail from my web pages. I have heard about security hole in FormMail.pl script which can be used by spammers. I would like to prevent that in my script. Can you...
10
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are...
3
by: martin smith | last post by:
Here's the scenario. I'm currently using cdosys/asp to send mail to our SMTP server. We use a product called MailFilter to check for SPAM. It doesn't work very well. If MailFilter isn't working...
1
by: Jayakumar | last post by:
HI, I am using System.web.mail class in my application to send mails. I am using SMTP server for the same. I can send mail to the intranet addresses, But when i send mails to Hotmail or other...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
8
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great ...
1
by: gemma.gill | last post by:
Hi There, I have a button on a form within access that sends a verification e- mail. My problem is that these e-mails are sending from individual user accounts rather than a genieric mailbox. ...
3
by: dskinibbyb | last post by:
Hi Everybody, I am sending mail using the new class in .Net 2.0. Here while sending internal mails it is giving me problem. Carriage return, Line feed and Spaces are lost while sending mails....
8
by: theaj | last post by:
Hi all, I am tryin to send a mail using ASP through my webpage. There are many web-pages that give code which looks like given below... from the code its obvious that we need to modify it with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.