Monday, March 26, 2012

SMTP throws exception

Hello,
I have an ASP page which was working fine and broke all of a sudden. It uses
SMTPMail to send out email, here is some code snippet:
mailObj.From = EmailFrom
mailObj.To = EMailTO
If (Len(Trim(EMailCc)) > 0) Then
mailObj.Cc = EMailCc
End If
mailObj.Subject = EmailSubject
mailObj.Body = EMailBody
mailObj.BodyFormat = MailFormat.Html
SmtpMail.Send(mailObj) 'Right now it always fails on this line.
The error message I got is:
External component has thrown an exception
I checked SmtpServer, It's working fine. I suspect there is something with
SMTP component installed in that machine, but I don't know how to reinstall
the component. Or is there anything else I should pay attention to ?
TIA> Or is there anything else I should pay attention to ?
Does the SMTP server allow relaying?
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Ed Chiu" <EdChiu@.discussions.microsoft.com> wrote in message
news:FE04B3FD-F025-46DB-A0E1-99DA78E50F98@.microsoft.com...
> Hello,
> I have an ASP page which was working fine and broke all of a sudden. It
> uses
> SMTPMail to send out email, here is some code snippet:
> mailObj.From = EmailFrom
> mailObj.To = EMailTO
> If (Len(Trim(EMailCc)) > 0) Then
> mailObj.Cc = EMailCc
> End If
> mailObj.Subject = EmailSubject
> mailObj.Body = EMailBody
> mailObj.BodyFormat = MailFormat.Html
> SmtpMail.Send(mailObj) 'Right now it always fails on this
> line.
> The error message I got is:
> External component has thrown an exception
> I checked SmtpServer, It's working fine. I suspect there is something with
> SMTP component installed in that machine, but I don't know how to
> reinstall
> the component. Or is there anything else I should pay attention to ?
> TIA
>
In addition to what Kevin says, does the smtp server require authentication
in order to send?
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Ed Chiu" <EdChiu@.discussions.microsoft.com> wrote in message
news:FE04B3FD-F025-46DB-A0E1-99DA78E50F98@.microsoft.com...
> Hello,
> I have an ASP page which was working fine and broke all of a sudden. It
> uses
> SMTPMail to send out email, here is some code snippet:
> mailObj.From = EmailFrom
> mailObj.To = EMailTO
> If (Len(Trim(EMailCc)) > 0) Then
> mailObj.Cc = EMailCc
> End If
> mailObj.Subject = EmailSubject
> mailObj.Body = EMailBody
> mailObj.BodyFormat = MailFormat.Html
> SmtpMail.Send(mailObj) 'Right now it always fails on this
> line.
> The error message I got is:
> External component has thrown an exception
> I checked SmtpServer, It's working fine. I suspect there is something with
> SMTP component installed in that machine, but I don't know how to
> reinstall
> the component. Or is there anything else I should pay attention to ?
> TIA
>
Yes. SMTP server allows relaying. In fact I have another server (the
production server) running the same codes as this one (development server)
which is working fine.
"Kevin Spencer" wrote:

> Does the SMTP server allow relaying?
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Neither a follower nor a lender be.
> "Ed Chiu" <EdChiu@.discussions.microsoft.com> wrote in message
> news:FE04B3FD-F025-46DB-A0E1-99DA78E50F98@.microsoft.com...
>
>

0 comments:

Post a Comment