email created with VB won't send

  • Follow


I have an application, written in VB6, that attempts to use MAPI to send an 
email (BCC) to a small number (typically 30-40) recipients. Here is the code:
            MAPISession.DownLoadMail = False
            MAPISession.SignOn
                
            MAPIMessages.SessionID = MAPISession.SessionID
        
            MAPIMessages.Compose
            MAPIMessages.MsgSubject = Subject
            MAPIMessages.MsgType = "SMTP"
            MAPIMessages.MsgNoteText = .tbIntro.Text & Paragraph & MessageText
            
            For Each strAddress In .Addresses
                MAPIMessages.RecipIndex = MAPIMessages.RecipCount
                MAPIMessages.RecipType = mapBccList
                MAPIMessages.RecipAddress = strAddress
                MAPIMessages.RecipDisplayName = strAddress
            Next strAddress
            MAPIMessages.Send True
            MAPISession.SignOff

On the face of it, this seems to work. The email appears in Outlook's out 
box. The problem is Outlook won't send it. If I click Send/Receive in Outlook 
(2003), all the other mail items get sent but the one created by my VB app 
just sits there.

If I create a new email in Outlook, copy and paste the text, subject and 
recipients from the "stuck" mail into the new one, the new one gets sent OK 
so clearly there's nothing wrong with the recipient list itself but there's 
something subtly wrong with the email I created. Have I missed something? Any 
suggestions what might be wrong with my email causing Outlook to refuse to 
send it?
-- 
Regards
Keith
0
Reply Utf 3/24/2010 5:05:02 PM

That looks like CDOSys or CDOEX or some other API (not the Outlook related 
CDO 1.21). There's almost no expertise in that here. My suggestion would be 
to use the Outlook object model and do things right so Outlook gets a 
properly formatted message.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Keith" <Keith@discussions.microsoft.com> wrote in message 
news:4BEE48B1-FF6E-43B2-B68B-8FF14B88D94E@microsoft.com...
>I have an application, written in VB6, that attempts to use MAPI to send an
> email (BCC) to a small number (typically 30-40) recipients. Here is the 
> code:
>            MAPISession.DownLoadMail = False
>            MAPISession.SignOn
>
>            MAPIMessages.SessionID = MAPISession.SessionID
>
>            MAPIMessages.Compose
>            MAPIMessages.MsgSubject = Subject
>            MAPIMessages.MsgType = "SMTP"
>            MAPIMessages.MsgNoteText = .tbIntro.Text & Paragraph & 
> MessageText
>
>            For Each strAddress In .Addresses
>                MAPIMessages.RecipIndex = MAPIMessages.RecipCount
>                MAPIMessages.RecipType = mapBccList
>                MAPIMessages.RecipAddress = strAddress
>                MAPIMessages.RecipDisplayName = strAddress
>            Next strAddress
>            MAPIMessages.Send True
>            MAPISession.SignOff
>
> On the face of it, this seems to work. The email appears in Outlook's out
> box. The problem is Outlook won't send it. If I click Send/Receive in 
> Outlook
> (2003), all the other mail items get sent but the one created by my VB app
> just sits there.
>
> If I create a new email in Outlook, copy and paste the text, subject and
> recipients from the "stuck" mail into the new one, the new one gets sent 
> OK
> so clearly there's nothing wrong with the recipient list itself but 
> there's
> something subtly wrong with the email I created. Have I missed something? 
> Any
> suggestions what might be wrong with my email causing Outlook to refuse to
> send it?
> -- 
> Regards
> Keith 

0
Reply Ken 3/24/2010 5:19:01 PM


1 Replies
249 Views

(page loaded in 0.145 seconds)

Similiar Articles:
















7/21/2012 5:08:21 PM


Reply: