I cannot get SMTP Virtual Server in IIS6 in Windows Server 2003 to send an
email. I have used the following code in an ISAPI dll. This code works in
Windows 2000 server. connection.Connected() returns true so I think it is
connection.SendMessage(msg) that fails.

CSMTPConnection connection
connection.Connect("DEV_SSP2",30000);
CMimeMessage msg;
if(connection.Connected())
{
msg.SetSender("sender@odpm.gsi.uk");
msg.AddRecipient("dale@home");
msg.SetSubject("ODPM Communication");
msg.AddText("The file you requested is attached.");
msg.AttachFile(LocalFileName1,"Your file","application/vnd.ms-excel")
if(connection.SendMessage(msg))
connection.Disconnect();
}

RE: Cannot send mail using CSMTPConnection in Windows Server 2003 by Surinder

Surinder
Mon Oct 25 06:19:01 CDT 2004

Have sorted this now.

"Surinder" wrote:

> I cannot get SMTP Virtual Server in IIS6 in Windows Server 2003 to send an
> email. I have used the following code in an ISAPI dll. This code works in
> Windows 2000 server. connection.Connected() returns true so I think it is
> connection.SendMessage(msg) that fails.
>
> CSMTPConnection connection
> connection.Connect("DEV_SSP2",30000);
> CMimeMessage msg;
> if(connection.Connected())
> {
> msg.SetSender("sender@odpm.gsi.uk");
> msg.AddRecipient("dale@home");
> msg.SetSubject("ODPM Communication");
> msg.AddText("The file you requested is attached.");
> msg.AttachFile(LocalFileName1,"Your file","application/vnd.ms-excel")
> if(connection.SendMessage(msg))
> connection.Disconnect();
> }
>
>