email created with VB won't send

Status
Not open for further replies.
K

Keith

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
 
K

Ken Slovak - [MVP - Outlook]

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.

"Keith" <Keith> 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
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
A Created a new user account and the local account cannot see email Using Outlook 3
P Newly created IMAP subfolders not showing up on email clients away from computer. Using Outlook 3
G Adding an attachment to email I just created (VBA) Outlook VBA and Custom Forms 1
M Copy "To" Address Value from a Newly Created Email to the "To" Address Field of Custom Form Using Outlook 4
J How do I send an email to multiple groups that I have not created, but that have been shared with me? Using Outlook 1
J How can I send an email to multiple groups that I have not created, but that have been shared with me? Using Outlook 1
J Autoreply email recieved from specific sender after deleting some text from body. Using Outlook 0
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 1
D Sending email from Office 365 alias in Outlook Using Outlook 4
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 3
S Body text of Email from invite date/time Outlook VBA and Custom Forms 8
R Outlook 2010 How do you export 2 email Accounts' 2010 Inbox Files to new computer (2019)? Using Outlook 1
R Auto display of new email does not work on non-default account Outlook VBA and Custom Forms 0
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
L Outlook saved email templates Using Outlook 1
B VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
T How can you include Junk Email in Search Results like you can include Deleted Items? Using Outlook 3
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
W Replyin to the reply-to email address Outlook VBA and Custom Forms 0
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
M Extract all links from Outlook email, send to Excel Using Outlook 2
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
B Outlook 2003 email sending & receiving suddenly stopped working Using Outlook 3
R List folders in a combo box + select folder + move emails from inbox to that folder + reply to that email Outlook VBA and Custom Forms 1
O Email not leaving Outbox when using Excel VBA to sync Outlook account Outlook VBA and Custom Forms 4
T The non-email functions Using Outlook 8
P Outlook 2013 Word Share doc as Email Attachment now brings up Eudora. Using Outlook 1
C How to rename subject line and forward the email Outlook VBA and Custom Forms 2
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
J Sent Items Folder NOT Showing Correct From Email Address Using Outlook 0
J Outlook Reply > From > Other Email Address... > Address Not Showing in Sent Items... From Email Outlook VBA and Custom Forms 0
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
Marc2019 Need help please! Cannot Setup my outlook email account on my Mac Outlook 2011 Using Outlook.com accounts in Outlook 2
HarvMan Hotmail - Sending email is undeliverable Using Outlook 4
R Error when trying to forward current email item Outlook VBA and Custom Forms 7
H In outlook 365 POP mail Inbox, email takes a long time or never arrives. Using Outlook 1
D Can Exchange Admin Center create a pst for users email/contacts/calendar? Exchange Server Administration 0
T After I send a new email, it remains in the Draft folder Using Outlook.com accounts in Outlook 3
P OWA Settings->Calendar->Events from Email; Setting changes do not hold Using Outlook 1
S How to export urls from email to excel and check the status of the url ? New Slipstick.com Articles 6
P Auto Insert Current Date or Time into Email Subject Outlook VBA and Custom Forms 2
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
M ERROR: None of your email accounts could send to this recipient Using Outlook 2
S save email from excel Outlook VBA and Custom Forms 1
T How can we view Blocked email addresses Using Outlook 6
F My hotmail calendar is not syncing with my outlook but my email is Using Outlook 3
O Multiple email accounts - hesitate to create a new profile Using Outlook 3
9 Outlook 2016 How to save an Outlook attachment to a specific folder then delete the email it came from? Using Outlook 1
C Outlook Autocomplete suggestions showing wrong person's name against an email address Using Outlook 0
T Outlook converts sent email to txt attachments when sync Using Outlook 0
Similar threads


















































Top