A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

email created with VB won't send



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 24th 10, 05:05 PM posted to microsoft.public.outlook.program_vba
keith
external usenet poster
 
Posts: 71
Default email created with VB won't send

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
  #2  
Old March 24th 10, 05:19 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default email created with VB won't send

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" wrote in message
...
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send option is not available for new appointment I created emil Outlook - Calandaring 1 September 25th 07 09:10 PM
Form created in Outlook will not send data filled in. Joanne19541 Outlook - Using Forms 4 September 5th 07 03:12 AM
hOW DO I SEND MY E MAIL MESSAGE TO A CREATED FOLDER? rexy Outlook - Calandaring 1 May 9th 07 11:32 PM
Including signature in email created with Add-In [email protected] Add-ins for Outlook 7 June 26th 06 02:56 PM
'always send to this recipient in Microsoft Outlook rich-text format' checked when created from a blackberry [email protected] Outlook - General Queries 0 January 27th 06 11:26 PM


All times are GMT +1. The time now is 12:44 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.