473,491 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mails are stuck in the Queue Folder

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..

Jul 23 '05 #1
1 4525

"Kalpesh" <ka************@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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
Jul 23 '05 #2

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

Similar topics

1
1894
by: Brent Burkart | last post by:
I have a process which used IIS SMTP to send emails. However, it looks as if everything is just being stuck in the mailroot\queue folder. Does anyone have any ideas why? Thanks, Brent
1
2046
by: Yazeed | last post by:
when i attempt to send an email message from an asp.net application using WINXP SMTP service, the message just stuck in the queue folder within the mail folder and it wont be sent. Thanks
3
2987
by: Dan Sikorsky | last post by:
I can send email using C# and SMTP, but keep closing the connection before the .eml file has left the Queue folder. The length of time the .eml file stays in the Queue folder is dependent on the...
1
8152
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...
0
2592
by: cpladmin | last post by:
We have a server configured for sending e-mails from out Extranet. It is on a DMZ as was the previous mail filter. It has been working, but since we changed our mail filter to be inside firewall,...
2
6191
by: beeswax | last post by:
Hi, Does anyone knows how to read e-mails from a specific folders in outlook? I only found out how to read the mails from the inbox folder and how to list all available folder. I just don't...
1
2020
by: ramss | last post by:
hi, I am using asp.net2.0 for sending mails.but all my mails are stucked in c:\inetpub\mailroot\queue folder. my smtp configuration also perfect . Pls reply to me
4
3964
by: vivekcyrus | last post by:
Hi. im using Windows xp and IIS 5.1 on a single machine. I created a new domain in IIS, did all the configurations but still i cannot send or receive mails on the new domain. the mails are either...
13
6639
by: btreddy | last post by:
Hii all, I've been searching in the internet just to know abt SMTP server. Can anybody tell me how to configure the SMTP server and how can i send the mails and how could i check whether...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
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,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.