ASP.NET email - messages ending upin the '\Inetpub\mailroot\Queue'

R

Robert Salasidis

I am trying to get an email application working in ASP.Net

I was trying to use a remote SMTP server (on my web site - but hosted
by a third party), but was constantly getting the 'Could not access
'CDO.Message' Object ' message.

I tried all teh suggestions I could find on Google, ut was unable to
get it to work.

In the end I decided to use my local host (using my local IP address.

The program completes as expected, no exceptions are thrown.

the problem is that all my emails are ending up in the
\Inetpub\mailroot\Queue directory on my local computer (running the
SMTP server)

The sizes of the emails are accurate.

Any ideas?



the relevant code is listed below

for(;(readStr = srEmail.ReadLine()) != null; )
{
try
{
try
{
MailMessage Message = new MailMessage();

Message.To = readStr;
Message.From = EmailAccountTextBox.Text;
Message.Subject = SubjectTextBox.Text;
Message.Body = htmlString;

foreach (string s1 in attachmentStrings)
{
MailAttachment myAttachment = new
MailAttachment(s1, MailEncoding.Base64);
Message.Attachments.Add(myAttachment);
}
try
{
// SmtpMail.SmtpServer =
SMTPServerTextBox.Text;
SmtpMail.SmtpServer = "192.168.0.5";
// SmtpMail.SmtpServer =
"216.119.106.22";
SmtpMail.Send(Message);
}
catch(System.Web.HttpException ehttp)
{
SendingLabel.Text = "Error Sending
Email - " + readStr + " Message - " + ehttp.ToString();
break;
}
}
catch(IndexOutOfRangeException)
{
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top