dbTalk Databases Forums  

Mails are stuck in the Queue Folder

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Mails are stuck in the Queue Folder in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kalpesh
 
Posts: n/a

Default Mails are stuck in the Queue Folder - 05-04-2005 , 07:01 AM






Hello All,

I wrote one code for sending mail by using Asp.Net+C#, My code is as
follows.

private void btnSend_Click(object sender, System.EventArgs e)
{
try
{
MailMessage email = new MailMessage();
if(rblHtml.Checked)
{
email.BodyFormat=MailFormat.Html;
}
if(rblText.Checked)
{
email.BodyFormat=MailFormat.Text;
}
email.From=txtSender.Text;
email.To=txtReceiver.Text;
email.Subject=txtSubject.Text;
email.Body=txtBody.Text;

string attach1=null;

if(opdAttachment1.PostedFile !=null)
{
HttpPostedFile ulFile=opdAttachment1.PostedFile;
int nFileLen=ulFile.ContentLength;

if(nFileLen>0)
{
strFileName=Path.GetFileName(opdAttachment1.Posted File.FileName);
strFileName="attachment/"+strFileName;
opdAttachment1.PostedFile.SaveAs(Server.MapPath(st rFileName));
MailAttachment attach=new
MailAttachment(Server.MapPath(strFileName));
email.Attachments.Add(attach);
attach1=strFileName;
}
}

SmtpMail.SmtpServer="127.0.0.1";

SmtpMail.Send(email);

if(attach1 !=null)
{
File.Delete(Server.MapPath(attach1));
}

lblMessage.Text="Your email has been sent successfully";


catch(Exception ex)
{
lblMessage.Visible=true;
lblMessage.ForeColor=Color.Red;
lblMessage.Text=ex.ToString();
}


When i press "SEND" button, the mail is delivered and i receive message
"Your email has been sent successfully". But the mail is not deliver to
target destination.

The Mail is stored in "C:\Inetpub\mailroot\queue" folder. After some
time, it is autometically stored in "Badmail" folder.

I use Windows 2000 Professional+.net 1.1 version.

I need some solution ... I am relatively new in .net .. Can anybody
help me please..


Reply With Quote
  #2  
Old   
Simon Hayes
 
Posts: n/a

Default Re: Mails are stuck in the Queue Folder - 05-06-2005 , 12:20 PM







"Kalpesh" <kalpesh.belkar (AT) gmail (DOT) com> wrote

Quote:
Hello All,

I wrote one code for sending mail by using Asp.Net+C#, My code is as
follows.

private void btnSend_Click(object sender, System.EventArgs e)
{
try
{
MailMessage email = new MailMessage();
if(rblHtml.Checked)
{
email.BodyFormat=MailFormat.Html;
}
if(rblText.Checked)
{
email.BodyFormat=MailFormat.Text;
}
email.From=txtSender.Text;
email.To=txtReceiver.Text;
email.Subject=txtSubject.Text;
email.Body=txtBody.Text;

string attach1=null;

if(opdAttachment1.PostedFile !=null)
{
HttpPostedFile ulFile=opdAttachment1.PostedFile;
int nFileLen=ulFile.ContentLength;

if(nFileLen>0)
{
strFileName=Path.GetFileName(opdAttachment1.Posted File.FileName);
strFileName="attachment/"+strFileName;
opdAttachment1.PostedFile.SaveAs(Server.MapPath(st rFileName));
MailAttachment attach=new
MailAttachment(Server.MapPath(strFileName));
email.Attachments.Add(attach);
attach1=strFileName;
}
}

SmtpMail.SmtpServer="127.0.0.1";

SmtpMail.Send(email);

if(attach1 !=null)
{
File.Delete(Server.MapPath(attach1));
}

lblMessage.Text="Your email has been sent successfully";


catch(Exception ex)
{
lblMessage.Visible=true;
lblMessage.ForeColor=Color.Red;
lblMessage.Text=ex.ToString();
}


When i press "SEND" button, the mail is delivered and i receive message
"Your email has been sent successfully". But the mail is not deliver to
target destination.

The Mail is stored in "C:\Inetpub\mailroot\queue" folder. After some
time, it is autometically stored in "Badmail" folder.

I use Windows 2000 Professional+.net 1.1 version.

I need some solution ... I am relatively new in .net .. Can anybody
help me please..

You'll probably get a better response in a .NET or ASP group rather than a
SQL Server one.

Simon




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.