MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sending email through asp.net web app

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ASPNet
Author Message
MOHSEN KASHANI



Joined: 13 Dec 2007
Posts: 1

PostPosted: Thu Dec 13, 2007 4:14 am    Post subject: Sending email through asp.net web app Reply with quote

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.

Archived from group: microsoft>public>dotnet>framework>aspnet
Back to top
View user's profile Send private message
Mark Rae [MVP]



Joined: 08 Aug 2007
Posts: 29

PostPosted: Thu Dec 13, 2007 1:48 pm    Post subject: Re: Sending email through asp.net web app Reply with quote

"MOHSEN KASHANI" wrote in message @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
Back to top
View user's profile Send private message
Braulio Diez



Joined: 08 Aug 2007
Posts: 14

PostPosted: Thu Dec 13, 2007 5:48 am    Post subject: RE: Sending email through asp.net web app Reply with quote

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/2006/07/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/ArticleBlog.aspx?KWID=45&Area=SMTP&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.
>
>
>
Back to top
View user's profile Send private message
ashkaan57



Joined: 08 Aug 2007
Posts: 2

PostPosted: Thu Dec 13, 2007 5:00 pm    Post subject: Re: Sending email through asp.net web app Reply with quote

On Dec 13, 3:48 am, Braulio Diez wrote:
> 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/2006/07/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/ArticleBlog.aspx?KWID=45&Area=SMTP&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:








and in the aspx file:

protected void Button1_Click(object sender, EventArgs e)
{
string strFrom = "me@here.com";
string strTo = "you@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 you@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:

but got the same error.

Thanks.
Back to top
View user's profile Send private message
ashkaan57



Joined: 08 Aug 2007
Posts: 2

PostPosted: Fri Dec 14, 2007 2:06 am    Post subject: Re: Sending email through asp.net web app Reply with quote

On Dec 13, 3:00 pm, ashkaa...@hotmail.com wrote:
> On Dec 13, 3:48 am, Braulio Diez wrote:
>
>
>
>
>
> > 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/2006/07/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/ArticleBlog.aspx?KWID=45&Area=SMTP&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:
>
>
>
>
>
>
>
>
> 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:
>
> 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.

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
how i Sending web page on an Email using aspdotnet? Dear all Please i want to send a web page using Email, i justt want to have the url of the site and the contents of the URL appear in the mail sent is there any one can help me doing that please i know how to send text mail but i donot know how to include

Sending SMS SMPPLIB 1.4

sending copies of objects Hi, I'm new to remoting and .Net, so please bear with me. I would like to send objects (instances of a class I've written) from one process to another. This process may or may not be running on the same machine, it could be running on another computer on

sending attachment from server to client Hi All, I have been trying to send an attachment from server to client. In the server I have written the following code [WebMethod] public string Attachment() { SoapContext ctx = string filePath =

Sending Client Side Event ? Hello Folks... From my control i need notify client side script about some events occurs. Any idea ? Regards Genival Carvalho Ps. Sorry my bad English.
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ASPNet All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group