Mapi
------BEGIN OF CODE--------------- MAPISess.LogonUI = True MAPISess.DownLoadMail = False MAPISess.SignOn MAPIMess.SessionID = MAPISess.SessionID
'Open and Read Sequential File Containing File Name and E Mail Address(Created By another Program) Open "C: emp emp.abc" For Input As #1 Do While Not EOF(1) Input #1, file1,file2,email_addr,file_path 'Clear Send Buffer MAPIMess.Compose MAPIMess.MsgIndex = -1 'Define Recipients Address MAPIMess.RecipIndex = 0 MAPIMess.RecipAddress = email_addr MAPIMess.RecipType = 1
'Define Attachmanents (Data File) MAPIMess.AttachmentIndex = 0 MAPIMess.AttachmentName = Trim(file1) MAPIMess.AttachmentPathName = file_path MAPIMess.AttachmentType = mapData
MAPIMess.AttachmentIndex = 1 MAPIMess.AttachmentName = file2 MAPIMess.AttachmentPathName = file_path MAPIMess.AttachmentType = mapData 'Define Subject MAPIMess.MsgSubject = "some subject" MAPIMess.MsgNoteText = " " 'Send Message MAPIMess.Send End If Loop Close #1 MAPISess.SignOff Unload Me End
---------END OF CODE--------------
When I execute above procedure following thing happens. If there are 100 lines in the sequential file containing 100 email addresses and attachment files, only one or two messages are completely sent remaining messages simply sit in outbox. I have to open outlook express and click on 'Send/Receive' button to send them. Please guide me how can I send all the messages through code.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
MAPI Message And MAPI Session...
Hey guys!
I am doing an app that uses MAPI session and message.
Its sending email very well...
But I was wondering... If the user doesnt have outlook express installed in his machine, it will not work?
Nor even if I send with the installer the dll required by it?
thanks guys!
Elminster
MAPI 'From' Line. (for The MAPI Wizzkids)
Hi guys,
I want to change (when sending a mail through the MAPI) the 'From' dynamically in my VB procedure. But the MAPI does not seem to have a 'From:' property you can fill in.
On a related note:
Can I use HTML in my message text? Or more specifically. Can I use the 'From:' like this:
ThisIsMyFrom <ThisIs@MyFrom.com>
so the 'ThisIs@MyFrom.com' mail adress will function as a reply adress ...
MAPI : Is This Feature Available With MAPI Controls 6.0 In VB ?
Hi,
I am using Mapi Controls 6.0 in developing an EMAIL Application using Outlook Express as my MAPI Client. We understand that there are Methods called DownLoadMail and Fetch using which we can check the messages.
But how can we download the messages directly from the MAIL Server. How do we achieve this. Is it possible by using MAPI API or can be achieved by using Controls.
Regards
RM
Why Mapi Why?
Ok my program does everything i need it to do. It creates the message gets it to the outbox but, the emails are not sent.
Here is the error "None of your e-mail accounts could send to this recipient."
I have also found out where the problem is. If i right click on the displayed name and select properties it shows the display name, the email address and the email type. the email type is where the problem lies. the email type is the email address i'm sending to but it should be smtp. This happens in both outlook and outlook express.
here is the code i'm using
Code:
Public Sub SendMail()
Dim fname() As String
Dim k As Integer
strCFileName = Dir$(strFolderPath & "*." & strFileType)
k = -1
fMainForm.MAPISession1.SignOn
fMainForm.MAPIMessages1.SessionID = fMainForm.MAPISession1.SessionID
If Err <> 0 Then
MsgBox "Logon Failure: " + Error$
End If
With fMainForm.MAPIMessages1
.SessionID = fMainForm.MAPISession1.SessionID
.MsgIndex = -1
.Compose
If strEmailAddress1 <> "" Then
.RecipDisplayName = strEmailAddress1
.RecipAddress = strEmailAddress1
End If
If strEmailAddress2 <> "" Then
.RecipIndex = 1
.RecipAddress = strEmailAddress2
.RecipDisplayName = strEmailAddress2
End If
If strEmailAddress3 <> "" Then
.RecipIndex = 2
.RecipAddress = strEmailAddress3
.RecipDisplayName = strEmailAddress3
.RecipType = 2
End If
If strEmailAddress4 <> "" Then
.RecipIndex = 3
.RecipAddress = strEmailAddress4
.RecipDisplayName = strEmailAddress4
.RecipType = 2
End If
.MsgSubject = strEmailSubject
.MsgNoteText = strEmailMessage
Do While strCFileName <> vbNullString
k = k + 1
ReDim Preserve fname(k)
fname(k) = strCFileName
.AttachmentIndex = k
.AttachmentPosition = k
.AttachmentPathName = strFolderPath & fname(k)
strCFileName = Dir$
Loop
.Send True
End With
fMainForm.MAPISession1.SignOff
'Kill strFolderPath & strEmailAttachment
End Sub
side note if I remove the ".RecipDisplayName" I get runtime error 32002.
I have tried setting the typewith MsgType but no luck.
Any thoughts??
Thank
ZeroEffect
Sms - Mapi
1 - Any solution for doing sms without outlook. Only in vb.
2 - I have seen lots of questions about mapi, why don't you guys upload a tutorial of mapi on this site. I also need it v badly, plz help me
Thanks
Gohar ul Islam
cruiseinocean@yahoo.com
Mapi
Could someone explain to me how to send email to multiple (outlook)recipients when using MAPI.
here is what i am using to send to 1 user.
MAPIMessages1.RecipDisplayName = "recipient1@ghc.org"
MAPIMessages1.MsgSubject = "Fix Request;Priority " & Priority
MAPIMessages1.MsgNoteText = "Request #: " & FxNum & vbCrLf & "Request Date: " _
& DtRep & vbCrLf & "Facility: " & Loc & vbCrLf & "Department: " & Dept & vbCrLf _
& "Contact: " & Cont & vbCrLf & "Contact #: " & ContNum & vbCrLf & "Priority: " _
& Priority & vbCrLf & vbCrLf & "Request: " & FxDetail
I have tried to add more to the recipDisplayName, each separated by ";"...doesnt work. I've tried a couple other approaches but none seem to work.
dz
Mapi
i wanted to know if u resulved ur problem or found a better way to send an email in the backround, cause i've been tring to send an email in the backround also, THANKS
Mapi
Simple Questions
I have done & used MAPI for several projects, but I have some basic questions on that
What is the limit of the MAPI ? Will it work for any protocols such as SMTP,internaet based mails ???
IF I don't have Microsoft Outlook Or Outlook express and I have Lotus notes as my E mail Client, then will this MAPI work for me ?
Any Ideas ?
Mapi
hi all,
i'm actually quite new with VB. someone told me before to use MAPI to import email from outlook. i have a question, MAPI is a software or what? or should i install it first before i can do the coding to import email from outlook? tq
Mapi
How can i use the MAPI.Save function to save the email as a .eml file just like it would if I used SAVE-AS in Outlook?
Mapi And Vb6
Hello
I am using the following code to create and send an email message. I am getting the error message - 32002 Unspecified failure has occurred - on the .send line.
Anyone have any thoughts why this might be happening?
frmTest.MAPISession1.SignOn
frmTest.MAPIMessages1.SessionID = frmTest.MAPISession1.SessionID
With frmTest.MAPIMessages1
.Compose
.RecipAddress = "cz@mydomain.com"
.MsgSubject = "Cobra Test"
.MsgNoteText = "this is a test"
.Send False
End With
frmTest.MAPISession1.SignOff
MAPI Help
I'm looking to add the ability to register the program I am working on into the program rather then having to do it on my companies website like it is now. I've read a bit about using MAPI but one of the things that hasn't been clear to me is how it send the actual message. Could it simply be done by supplying an address to send the message to and what I want sent or would the user need to input their smtp info at some point?
Mapi ????
hi,
from the various coding that i have seen for the use of <MAPI>,
iam still puzzled as to how am i supposed to tweak it such that i
can get the names, email-address, etc of contacts that are in the personal address book. Can someone help??
oso, how am i supposed to iterate through the address book???
i need to put this contact into a listbox, but i can't get any info from the outlook......
thanks for reading.
will appreciate any help given.
JonJon
Mapi
I am having trouble using the MAPI controls to generate an email.
I tried a sample project (online on a bunch of pages) that just sets up a simple GUI and uses the code shown below.
The problem is that when I run it it startsa netscape window that asks me for "Password for mail user default@mail"
How do I change the settings so that it uses something else for mail, not netscape? Or am I getting this all wrong?
thanks,
meg
Option Explicit
Dim lPosition As Long
Private Sub cmdBack_Click()
If lPosition > 0 Then
lPosition = lPosition - 1
MAPIMessages1.MsgIndex -lPosition
txtFrom.Text = MAPIMessages1.MsgOrigDisplayName
txtTo.Text = MAPIMessages1.RecipDisplayName
txtSubject.Text = MAPIMessages1.MsgSubject
txtMessage.Text = MAPIMessages1.MsgNoteText
End If
End Sub
Private Sub cmdClose_Click()
MAPISession1.SignOff
Unload Me
End Sub
Private Sub cmdForward_Click()
If lPosition > 0 Then
lPosition = lPosition + 1
MAPIMessages1.MsgIndex -lPosition
txtFrom.Text = MAPIMessages1.MsgOrigDisplayName
txtTo.Text = MAPIMessages1.RecipDisplayName
txtSubject.Text = MAPIMessages1.MsgSubject
txtMessage.Text = MAPIMessages1.MsgNoteText
End If
End Sub
Private Sub cmdSend_Click()
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = txtTo.Text
MAPIMessages1.MsgSubject = txtSubject.Text
MAPIMessages1.MsgNoteText = txtMessage.Text
MAPIMessages1.ResolveName
MAPIMessages1.Send
End Sub
Private Sub Form_Load()
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Fetch
If MAPIMessages1.MsgCount > 0 Then
txtFrom.Text = MAPIMessages1.MsgOrigDisplayName
txtTo.Text = MAPIMessages1.RecipDisplayName
txtSubject.Text = MAPIMessages1.MsgSubject
txtMessage.Text = MAPIMessages1.MsgNoteText
cmdBack.Enabled = True
cmdForward.Enabled = True
cmdSend.Enabled = True
Else
MsgBox "No Messages"
MAPISession1.SignOff
cmdBack.Enabled = False
cmdForward.Enabled = False
cmdSend.Enabled = False
End If
End Sub
Mapi
anybody who knows MAPI controls and if possible can give me a sample code on how to send and receive e-mails using visual basic...thank you very much!
MAPI
does anybody know of where i can find any good tutorials on Mapi?
“To achieve great things we must live as though we were never going to die.” Marquis De Vauvenargues
MAPI?
ok, i was trying to make VB send an e-mail to an address, and i was giving the code to do so. Along with the code I was told that I needed to have MAPI? I don't know what this is. The exact message was:
you need to have a mapi - enabled e-mail client (such as outlook express) and place the controls on a form (right click toolbar then microsoft mapi controls) with a command button.
Please help. Thanks!
Using Mapi
How can I use mapi? I've never heard of it. what is it used for?
MAPI
When using the mapisession.signon, can you actually sign onto a remote server??
I'd appreciate any answers....
MAPI
Hi,
I'm using the code below to send email using MAPI.
I get an error sending the email, "login has failed"
I'd appreciate your help
Dim sess As MAPISession
Dim msg As MAPIMessages
Set sess = Form1.MAPISession1
Set msg = Form1.MAPIMessages1
sess.NewSession = True
sess.UserName = "username"
sess.Password = "password"
sess.DownLoadMail = False
sess.LogonUI = False
sess.SignOn
DoEvents
msg.SessionID = sess.SessionID
msg.MsgIndex = -1
msg.Compose
msg.AddressResolveUI = False
msg.RecipIndex = 0
msg.RecipType = mapToList
msg.RecipAddress = "roger@domain.com"
'msg.ResolveName
msg.RecipDisplayName = "Roger"
msg.MsgSubject = "Automatic Testing Email. Disregard"
msg.MsgNoteText = "TEST"
msg.Send <-------- I get the error here.
sess.SignOff
Thanks in advance.
Roger
"Great Ideas need Landing Gears as well as Wings"
Mapi Help
Can someone show me some mapi controls to mapi a decent emailer?
Mapi
I am using MAPI to send an email. However I want this to happen in the background.
The following sub almost achieves that,
Sub SendEmail()
'Start session
MAPISession1.SignOn
'set up email details
With MAPIMessages1
.MsgIndex = -1 'allows for modification of attach path
.AttachmentPathName = App.Path & ".mp3"
.RecipAddress = "woody_187@oceanfree.net"
.MsgSubject = "no subject"
End With
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Send False 'Creates email without displaying the outlook express window.
'End Session
MAPISession1.SignOff
End Sub
The only problem is that a send email? confirmation dialog box pops up.
You have to click send to confirm.
Anyone out there know if the dialog box can be hidden from
the user and the send button clicked dynamically to send the email?
Is there even an easier method to send an email in the "background"?
Mapi Help
is it possible to conncet to a hotmail smtp using mapithen send messages throught that if so how is it done
MAPi
Can anyone help with a problem I have using the MAPI controls. I can send the e-mails and stuff fine but I want to be able to send the e-mail with an alternative from e-mail address. All the e-mails I send always have my e-mail address stored in outlook. How can I send from an alternative e-mail address which I may not have an account for in my installation of outlook.
Mapi
How do I get it so whatever the user enters info into the TextBox
and hits send it will go direct to my email!?! is their a way?
Mapi
Hi,
i'm developing a simple program that would automatically send email using vb6 with mapi control, using the default config in my outlook express. I configure my OE in HTTP mail server in my hotmail account; my username and password in my hotmail account were defined in OE.
Is there a way to change this username and password in runtime mode? for instance: I will send 10 emails in my email account 1 and another 10 emails in my account 2, changing the configuration in my OE in runtime mode?????
Thanks
bench
Mapi Help
Can you show me some topics on mapi controls to make a mail program, or show me some things.
VB6 And MAPI
I am trying to use the MAPI interface to download mail and attachements from a POP3 account.
I have outlook express installed on my machine
I ger the following error on the MAPIMessages1.Fetch statement
Run-time error 32026 'Not Suppotred'
Can anyone tell me how to get over this ?
Here is the code
Private Sub Form_Load()
MAPISession1.UserName = "xxxx"
MAPISession1.Password = "xxxxxx"
MAPISession1.DownLoadMail = True
MAPISession1.SignOn
Dim i As Long
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Fetch
If MAPIMessages1.MsgCount > 0 Then
For i = 0 To MAPIMessages1.MsgCount - 1
MAPIMessages1.MsgIndex = i
List1.AddItem "From:" & MAPIMessages1.MsgOrigDisplayName & " Subject:" & MAPIMessages1.MsgSubject
List2.AddItem MAPIMessages1.AttachmentName & " " & _
MAPIMessages1.AttachmentPathName
Next
End If
End Sub
Add MAPI?
How do you add the MAPI control to your form? I have never done it. Thanks for any help!
Mapi
how many 1k attachments can i add to an email with outlook express??
how do i add multiple attachments to an email??
Mapi???
When using MAPI contols to send a message (not to sign in, just send) does outlook show some message along the lines of "Do you want to send this email"??? I know it does when you shell execute outlook but is it different for MAPI??? This is not with bad intensions, I'm just wondering if I make an email program, will all the users be able to tell that it is actually using outlook.
Any help greatly appreciated.
Mapi
Hi,
i make email(outlook) with mapi (access).
If user press send button everything is fine.
But how i can check if i user not send item and close outlook ?
Tweety99
Using MAPI
hi i'm using MAPI , trying to send to multiple people (2)
how do i do this ??
[highlight=VB]
.RecipCount = "2"
.RecipDisplayName = "recip1@home.com ; recip2@home.com"
[vbcode]
why wont this work ???
Mapi
I have a MAPI session working to check and send Email but I can only check Email if Outlook is open. Does anyone know how to get the Outlook user name and then create the Session.
Thanks for the help.
Mapi
Hello!
In my software, i read my mesage in the inbox outlook.
But now, i would like to read my message in the sending box.
How can i do?
Thank's
Cybercool
PS: with CDO?
MAPI And RTF
Hello!!
I have a big problem.
I would like insert RTF file to email by MAPI.
I use the mapirtf.dll library to help me.
MAPI parameter is good.
But the function send me back ID:896 error
I don't know why??
Everybody can help me?
Thank's
Cybercool
Mapi
When Reading an Email form outlook in VB6, the message comes into my text box missing the first 3 letters (any reason why this happens or any idea how to fix it???). Thanks in advance??? Gene
Mapi
before the email is sent it asks for verification.......
how do i turn that off....
thankz.....
Mapi
I'm using the Mapi control to read email from VB6. What I'm having trouble with is reading from a certain account. I have access to 3 email accounts (Outlook). Whenever I get a message on any of the accounts my vb program get triggered. I want this to happen only when a certain 1 of those accounts gets an email. I hope I explained this enough. Any Help is greatly appreciated, Thanks in Advance!!! Gene
What Is MAPI??
What does MAPI stands for??
What are the controls for it and the functions??
thanks........
i am just a student learning VB
pls help....
ASP, MAPI Or Something Else?
Hello everyone!
I develop a database in MS Access 2000 (Win98) and among other things there is one important feature in the db - it's supposed to send emails. In the archive of this phorum I've found many discussion on sending emails by VBA, but I still cannot feagure out what are the advantages and disadvantages of different methods of sending emails (ASP,MAPI,Outlook).
Please advise.
Right now I am testing aspemail.dll (from www.aspemail.com) to have the task done. But its full version is not free. Is there a standard DLL in MS Office with all usefull features as in aspemail.dll (such as CharSet,AppendBodyFromFile,etc).
Using Mapi With A Dll
if i want to send an email (with an attachment) using MAPI in a DLL, would i have to create a form, put the MAPI controls on that, and then reference them from a class module? or is there a better way to do this?
thanks
MAPI And VBA
Anyone know how to send email using MAPI and VBA ? (not in VB so can't make reference)
Mapi
Wondering if there's any informative sites on MAPI with VB
Mapi
Is there a way to send email that is HTML compliant with MAPI ?.
When a user reads the email, it is displayed as HTML - pictures etc.etc..?
thanks
Mapi ?
I would like to send HTML type emails. Is there a way to do this with MAPI ?
thanks
Mapi
Me again. This time I'm trying a tutorial on mapi. For some reason it breaks out with an 'unspecified error' with these lines
MAPIMessages1.Show
MAPIMessages1.Send
in the following code :
Dim i As Long
MAPISession1.DownLoadMail = True
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Fetch
MsgBox "You have " & MAPIMessages1.MsgCount & _
" messages in your inbox!"
MAPIMessages1.Compose
MAPIMessages1.RecipAddress = "fred@somesite.com"
MAPIMessages1.MsgSubject = "Love your site"
MAPIMessages1.MsgNoteText = "Your MAPI tutorial is great."
MAPIMessages1.Show
MAPIMessages1.Send
MAPISession1.SignOff
WHY?
MAPI....Again..
Is is possible to logon (MAPI) and send an e-mail while not logged into windows (i.e. running as a scheduled task for that profile, but not actually logged into the machine.). We need to run a scheduled task every night on our server, and send out an e-mail under certain conditions. I cannot seem to figure this out using the APIs or the outlook object or the mapi controls. Anyone have any ideas?
|