CDO Won't Send My Message (sometimes) 
Author Message
 CDO Won't Send My Message (sometimes)

Because I can't easily set the Reply To field in a Mail Item (which is what
I'd really like to do), I've created a CDO message and used    objMsg.From
to set who my message is from (and thereby allowing the user to get the
correct addresss when replying.)

However, on one of the three networks that I've tested on, the cdo message
won't send.  On the other two networks, it works fine.  It works perfectly
at home via a cable modem, at my office via DSL but not at a third site
which connects to the internet via a T1.  I'm trying at all three locations
with the exact same laptop.  Again, the code seems to work, even copying the
Subject and Message from a MailItem to a Message.  I'm thinking it's some
kind of network setting.

I've included part of the code below.  Any thoughts or suggestions would be
greatly appreciated.

Thanks,
Bruce

Sub CreateAndSend(objMailItem As MailItem, TOs As String, BCCs As String,
FROMs As String)
    Dim objSession As MAPI.Session
    Dim objMsg As New Message
    Dim counter_i As Integer
    Dim itemname As String

    ' start CDO session
    Set objSession = CreateObject("MAPI.Session")
    objSession.Logon , , False, False

    objMsg.From = FROMs
    objMsg.To = TOs
    objMsg.BCC = BCCs
    objMsg.Subject = objMailItem.Subject
    objMsg.TextBody = objMailItem.Body

'Handle Attachments
    For counter_i = 1 To objMailItem.Attachments.Count
        itemname = ""
        itemname = "c:\" + itemname +
objMailItem.Attachments.Item(counter_i).FileName
        objMailItem.Attachments.Item(counter_i).SaveAsFile (itemname)
        objMsg.AddAttachment (itemname)
        Kill itemname
    Next

    objMsg.Send

    Set objSession = Nothing
    Set objMsg = Nothing
End Sub



Sun, 24 Apr 2005 02:27:19 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CDO Won't Send My Messages (sometimes)

2. MAPI message Send method puts message in Outbox but it isn't actually sent

3. Why Won't my ActiveX Control run(Sometimes)

4. Could not access 'CDO.Message' object

5. Could not access 'CDO.Message' object

6. CDO.Message.1 error '8007000e'

7. Email text doesn't appear in sent items (sometimes)

8. sometimes he does it sometimes he doesn't

9. Loosing text when sending mail via CDO Messaging

10. Winmail.dat is attached when I send i message with CDO

11. Email Priority by sending with CDO.Message

12. Error sending message via CDO

 

 
Powered by phpBB® Forum Software