Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2006, 11:12 AM
Authorized User
 
Join Date: Apr 2006
Posts: 79
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via AIM to anujrathi Send a message via MSN to anujrathi Send a message via Yahoo to anujrathi
Default Send mail failed using asp.net

Hi friends,
I have written a simple application to send mail using asp.net. Before describing my codeing problem, I want to ask somthing related to the SmtpMail.Send() method.

When we create an object of the MailMessage class, then why there is no any property for password. Without password how one can access the mail acount. Pls tell me what is the exact background of this method.

Now I am not able to send mail using my asp.net application. My code is:

MailMessage objMailMsg = new MailMessage();
objMailMsg.From = txtFrom.Text.Trim();
objMailMsg.To = txtTo.Text.Trim();
objMailMsg.Subject = txtSubject.Text.Trim();
objMailMsg.Body = txtName.Text + ", " + txtComments.Text;
try
{
SmtpMail.Send(objMailMsg);
Response.Write("Your mail has been send successfully");
}
catch(Exception exc)
{
Response.Write("Send fail: " + exc.ToString());
}

I shows error message. Pls tell me that Is there any special settings for this type of applications
means any setting for POP3 server or SMTP server.
pls give me a proper solution.......
 
Old June 22nd, 2006, 07:59 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Anujrathi,
     Before you call SmtpMail.Send you need to setup a mail server for the script to access.

                SmtpMail.SmtpServer = mail.domain.com;

As far as needing a username and password I THINK that as long as you send mail within the same domain you dont need to provide credentials. For example, if the recipient is [email protected] and i have the sender as [email protected] this should freely pass through your mail server. (I do it with a few of my Intranet applications and our SMTP server requires authenticaion and I never supply it any credentials.)

HtH

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to send mail with vb.net Koeno VB How-To 4 July 20th, 2008 05:01 AM
Send calendar invite using System.Net.Mail bbeau .NET Framework 2.0 0 November 20th, 2007 09:28 PM
Send Mail with Attachment using Asp rajchennai J2EE 0 June 30th, 2007 01:39 AM
How to send the mail in ASP.NET n.nsivakumar ASP.NET 1.0 and 1.1 Professional 2 July 26th, 2006 03:49 PM
Send E-mail from .asp page LiDenning Classic ASP Professional 2 April 28th, 2006 05:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.