Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > CDOSYS SMTP

Reply
Thread Tools

CDOSYS SMTP

 
 
MM User
Guest
Posts: n/a
 
      08-03-2008
Hi,

I'm using CDOSYS for sending out emails, while designing my asp pages
locally I need to set the server to localhost, however for production I need
to set it to our smtp server (smtp.companyname.co.uk) is there a way to set
IIS to use the smtp server ?

Thanks

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      08-03-2008
"MM User" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm using CDOSYS for sending out emails, while designing my asp pages
> locally I need to set the server to localhost, however for production I

need
> to set it to our smtp server (smtp.companyname.co.uk) is there a way to

set
> IIS to use the smtp server ?


This is my stock CDOSYS emailling code:-

Option Explicit

Const cdoSendUsingMethod =
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSMTPServer =
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPickupDirectory =
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
Const cdoSMTPServerPort =
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"

Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2

Dim oMsg : Set oMsg = CreateObject("CDO.Message")
Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

With oConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.companyname.co.uk"
.Item(cdoSMTPServerPort) = 25
.Update
End With

oMsg.From = "Me <(E-Mail Removed)>"
oMsg.To = "Bloke <(E-Mail Removed)>"
oMsg.Subject = "Test"
oMsg.HTMLBody = "<html><body>Hello World</body></html>"
Set oMsg.Configuration = oConfig

oMsg.Send

Note the SMTP server field here is being set using the server you specify.

--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SMTP Emailing with CDOSYS =?Utf-8?B?Um9i?= ASP .Net 2 07-11-2007 07:24 PM
ASP CDOSYS SMTP Email attachments are being corrupted rschaeferhig ASP General 4 03-29-2006 10:53 PM
Sending SMTP mail when SMTP server is unavailable matthewjbarr@gmail.com Java 3 01-24-2006 06:53 PM
sending of mail (smtp) - connection refused - but smtp server isrunning! Alex Hunsley Python 4 06-29-2004 04:30 PM
RE: sending of mail (smtp) - connection refused - but smtp serveris running! Raaijmakers, Vincent \(GE Infrastructure\) Python 0 06-29-2004 02:38 PM



Advertisments