Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2006, 01:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default CDOSYS

Hi,

I'm using the following code to try and send an e-mail via SMTP. THe e-mail gets created OK, but ends up in my C:\Inetpub\mailroot\Drop folder on my local SMTP server. Anybody know what I have to do to get it sent?

Thanks,

Bob

Code:
Sub SendMail1()


Dim MailMsg As CDO.Message, MailConf As CDO.Configuration, MCFields As Object

    Set MailMsg = New CDO.Message

    Set MailConf = New CDO.Configuration

    Set MCFields = MailConf.Fields



    Rem use the following when writing vbscript

    'Dim MailMsg As Object, MailConf As Object, MCFields As Object

    'Set MailMsg = CreateObject("CDO.Message")

    'Set MailConf = CreateObject("CDO.Configuration")

    'Set MCFields = MailConf.Fields

        '       Configure SMTP Mail
    'MCFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    MCFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  '  SMTP

    'MCFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
    MCFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"  'SMTPServer

'    MCFields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPasswd
'
'    MCFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPUID

    MCFields.Item(cdoSMTPAuthenticate) = cdoNTLM

    MCFields.Update

    Set MailMsg.Configuration = MailConf

    MailMsg.TextBody = "testing e-mail"

    MailMsg.Subject = "testing e-mail"

    MailMsg.To = "bobbedell15@msn.com"

    MailMsg.From = "me"

    MailMsg.Send

End Sub
 
Old February 14th, 2006, 10:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

I found a herd of e-mail messages created by this code in my C:\Inetpub\mailroot\Queue directory. The relay interval is set to 15 minutes but none of the messages get sent out. I'm just using the default installation of SMTP on my localhost IIS server and trying to send messages to my own e-mail address at bobbedell15@msn.com? Any idead how to tweak the code to do this?

Thanks again,

Bob





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem using CDOSYS shankhan Classic ASP Components 1 January 9th, 2009 11:22 AM
CDOSYS Error cancer10 Classic ASP Components 1 May 21st, 2007 10:53 PM
CDONTS to CDOSYS icis Classic ASP Basics 1 March 2nd, 2006 06:27 PM
How do you use CDOSYS mail SoC Classic ASP Basics 5 April 20th, 2005 10:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.