G
Guest
I have created a small windows app that gathers some user entered data, then
prints it to a designated printer.
A specific person then collects the prints from the printer and processes
the info contained thereon.
This all happens within an organisation and no external communication is
required whatsoever.
This works quite well, but now I have been asked to have the application
send an email to the nominated person, informing them that there is a
document on the printer to collect.
Well... it all went south from there.
This is what I have done.
Sub MailUser()
Dim obj As System.Web.Mail.SmtpMail
Dim mail As New System.Web.Mail.MailMessage()
With Mail
.To = "(e-mail address removed)"
.From="(e-mail address removed)"
.BodyFormat=MailFormat.Text
.Subject="Subject goes here"
.Body="This is the body of the mail"
End With
obj.SmtpServer="myserver"
obj.Send(Mail)
End Sub
No go - it was generating a CDO message error, looking a little deeper, the
inner exception is
"System.Runtime.InteropServices.COMException (0x80040213): The transport
failed to connect to the server."
I thought it may have been an smtp problem, perhaps I had the syntax of the
server wrong? I have tried every potentially viable variant that I can think
of, such as the IP, the UNC path, the smtp name, the server name etc. Same
result with all.
We are using Exchange 2003 and this mail is purely for a LAN application, no
attachments, no fancy formatting, just a small text mail, easy - or so I
thought.
Any thoughts appreciated.
We have VS .Net 2002 with .NET 1.0 SP3
Regards - Peter
prints it to a designated printer.
A specific person then collects the prints from the printer and processes
the info contained thereon.
This all happens within an organisation and no external communication is
required whatsoever.
This works quite well, but now I have been asked to have the application
send an email to the nominated person, informing them that there is a
document on the printer to collect.
Well... it all went south from there.
This is what I have done.
Sub MailUser()
Dim obj As System.Web.Mail.SmtpMail
Dim mail As New System.Web.Mail.MailMessage()
With Mail
.To = "(e-mail address removed)"
.From="(e-mail address removed)"
.BodyFormat=MailFormat.Text
.Subject="Subject goes here"
.Body="This is the body of the mail"
End With
obj.SmtpServer="myserver"
obj.Send(Mail)
End Sub
No go - it was generating a CDO message error, looking a little deeper, the
inner exception is
"System.Runtime.InteropServices.COMException (0x80040213): The transport
failed to connect to the server."
I thought it may have been an smtp problem, perhaps I had the syntax of the
server wrong? I have tried every potentially viable variant that I can think
of, such as the IP, the UNC path, the smtp name, the server name etc. Same
result with all.
We are using Exchange 2003 and this mail is purely for a LAN application, no
attachments, no fancy formatting, just a small text mail, easy - or so I
thought.
Any thoughts appreciated.
We have VS .Net 2002 with .NET 1.0 SP3
Regards - Peter