473,396 Members | 1,913 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,396 software developers and data experts.

Sending email through asp.net web app

Hi,
I am working on an intranet web application and need to be able to send
email through the application. I have to use an Exchange server to do this.
Can you tell me what I need to set up, what information I need to have or
collect?

Thanks.
Dec 13 '07 #1
4 3252
Hi,

First of all speak with the network administrator and ask for an SMTP
server to rely on and send e-mails, problably he will give you an address,
user and password, check with a telnet if it's working fine:

http://msexchangeteam.com/archive/20...14/428324.aspx

Once you have checked that the account is working fine, you can code the
..net code, use system.net.mail namespace:

http://www.systemnetmail.com/

More info about how to send e-mails on .net:

http://www.tipsdotnet.com/ArticleBlo...TP&PageIndex=0

Good luck
Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"MOHSEN KASHANI" wrote:
Hi,
I am working on an intranet web application and need to be able to send
email through the application. I have to use an Exchange server to do this.
Can you tell me what I need to set up, what information I need to have or
collect?

Thanks.
Dec 13 '07 #2
"MOHSEN KASHANI" <mk******@verizon.netwrote in message
news:uz**************@TK2MSFTNGP06.phx.gbl...
I am working on an intranet web application and need to be able to send
email through the application. I have to use an Exchange server to do
this.
Can you tell me what I need to set up, what information I need to have or
collect?
http://geekswithblogs.net/cubeberg/articles/78704.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 13 '07 #3
On Dec 13, 3:48 am, Braulio Diez <braulio121NOS...@yahoo.eswrote:
Hi,

First of all speak with the network administrator and ask for an SMTP
server to rely on and send e-mails, problably he will give you an address,
user and password, check with a telnet if it's working fine:

http://msexchangeteam.com/archive/20...14/428324.aspx

Once you have checked that the account is working fine, you can code the
.net code, use system.net.mail namespace:

http://www.systemnetmail.com/

More info about how to send e-mails on .net:

http://www.tipsdotnet.com/ArticleBlo...TP&PageIndex=0

Good luck
Braulio

/// ------------------------------
/// Braulio Diez
///
///http://www.tipsdotnet.com
/// ------------------------------

"MOHSEN KASHANI" wrote:
Hi,
I am working on an intranet web application and need to be able to send
email through the application. I have to use an Exchange server to do this.
Can you tell me what I need to set up, what information I need to have or
collect?
Thanks.- Hide quoted text -

- Show quoted text -
Thanks for the reply Braulio. I conatcted the administrator and was
given the mail server name. I was told I do not require user id and
password. So, in my web.config I added:
<system.net>
<mailSettings>
<smtp>
<network host="mailrelay.agencyname.gov" />
</smtp>
</mailSettings>
</system.net>

and in the aspx file:

protected void Button1_Click(object sender, EventArgs e)
{
string strFrom = "me@here.com";
string strTo = "yo*@here.com";
MailMessage mm = new MailMessage(strFrom, strTo);
mm.Subject = "Test Email from ASP.NET";
mm.Body = "This is a test email sent from within an ASP
application.";
mm.IsBodyHtml = false;
mm.Priority = MailPriority.Normal;
SmtpClint sc = new SmtpClient();
// SmtpClient sc = new SmtpClient("mailrelay.agencyname.gov");
// sc.Credentials = new NetworkCredential();
sc.Send(mm);
}

I get an error from Symantec Email Proxy:

Your email message to yo*@here.com
with mail subject of
Test Email from ASP.NET
was unable to be sent because the connection to your mail server was
interrupted.
Please open your email client and re-send the message from the Send
Message folder.

I tried changing the web.config to read:
<network host="mailrelay.agencyname.gov" userName="" password="" />
but got the same error.

Thanks.
Dec 13 '07 #4
On Dec 13, 3:00 pm, ashkaa...@hotmail.com wrote:
On Dec 13, 3:48 am, Braulio Diez <braulio121NOS...@yahoo.eswrote:


Hi,
First of all speak with the network administrator and ask for an SMTP
server to rely on and send e-mails, problably he will give you an address,
user and password, check with a telnet if it's working fine:
http://msexchangeteam.com/archive/20...14/428324.aspx
Once you have checked that the account is working fine, you can code the
.net code, use system.net.mail namespace:
http://www.systemnetmail.com/
More info about how to send e-mails on .net:
http://www.tipsdotnet.com/ArticleBlo...TP&PageIndex=0
Good luck
Braulio
/// ------------------------------
/// Braulio Diez
///
///http://www.tipsdotnet.com
/// ------------------------------
"MOHSEN KASHANI" wrote:
Hi,
I am working on an intranet web application and need to be able to send
email through the application. I have to use an Exchange server to do this.
Can you tell me what I need to set up, what information I need to have or
collect?
Thanks.- Hide quoted text -
- Show quoted text -

Thanks for the reply Braulio. I conatcted the administrator and was
given the mail server name. I was told I do not require user id and
password. So, in my web.config I added:
<system.net>
<mailSettings>
<smtp>
<network host="mailrelay.agencyname.gov" />
</smtp>
</mailSettings>
</system.net>

and in the aspx file:

protected void Button1_Click(object sender, EventArgs e)
{
string strFrom = "m...@here.com";
string strTo = "y...@here.com";
MailMessage mm = new MailMessage(strFrom, strTo);
mm.Subject = "Test Email from ASP.NET";
mm.Body = "This is a test email sent from within an ASP
application.";
mm.IsBodyHtml = false;
mm.Priority = MailPriority.Normal;
SmtpClint sc = new SmtpClient();
// SmtpClient sc = new SmtpClient("mailrelay.agencyname.gov");
// sc.Credentials = new NetworkCredential();
sc.Send(mm);
}

I get an error from Symantec Email Proxy:

Your email message to y...@here.com
with mail subject of
Test Email from ASP.NET
was unable to be sent because the connection to your mail server was
interrupted.
Please open your email client and re-send the message from the Send
Message folder.

I tried changing the web.config to read:
<network host="mailrelay.agencyname.gov" userName="" password="" />
but got the same error.

Thanks.- Hide quoted text -

- Show quoted text -
OK, I got it.
I was testing this from my workstation and I already had setup an SMTP
server (from within Outlook) and when I tried to use the other SMTP
server (mailrealy...., given to me by administrator) from within the
application, it choked. If I use the same SMTP server as listed in
Outlook, it works fine. Thank you all for your suggestions and help.
Dec 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
0
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
3
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
31
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.