|
Hi,
I am using MapiSendMail in my program (I wrote it before I saw your class - should have checked here first).
The program does not know who to send the message to - and therefore has to leave recipient info blank, and recipient count to 0. (The program is mostly about gathering correct content to include in an e-mail). I set the flag to MAPI_DIALOG and everything works - my content is in the body, the address field is blank, and the user is shown the standard New Mail dialog
- only this dialog is Modal. Till the user is finished with it, he/she cannot return to my program.
Is there any way I can make this not modal? - passing a HWND value as the second parameter in the MapSendMail call does not seem to make a difference. (the on-line help in MSDN says that if you leave it as 0, the dialog is application modal)
I would appreciate any help. (Your class perhaps does not encounter this, as it requires at least one recipient)
|
|
|
|
|
Simple MAPI does not provide for this. As I have pointed out in other replies in theis forum, you will need to look elsewhere if you want this level of control. e.g. SMTP
|
|
|
|
|
Hello PJ:
I Have a question about MAPI,I hope you can help me.
I want to send email from my application(non-MFC application). I wat to use MAPI if it is possible.The problem is,I don't know about setting on my user computer and I don't want to bother him with asking questions,So In MAPILogon function I don't know what exactly should I fill? (For example I want to send mail from contant mail for all users,not their own mailbox)
Mazy
No sig. available now.
|
|
|
|
|
You really are providing a number of contradicting requirements:
1. First my class is MFC only, so you will need to use the MAPI functions directly.
2. You want to use MAPI but you do not want to bother the end user. Remember MAPI is not always installed and delivery of emails in MAPI is very much provider dependent.
3. You want to said mail from some other address other than what MAPI is configured to do. Cannot BE DONE!!.
4. For what you need to fill in just read the documentation on the MSDN which explains MAPI.
Finally, IMHO I'd suggest you use SMTP it at all possible instead.
|
|
|
|
|
thanks PJ.
pjnaughter wrote:
Finally, IMHO I'd suggest you use SMTP it at all possible instead.
Yes,that what I think too.
Mazy
No sig. available now.
|
|
|
|
|
Hello,
Pardon for my bad English.
I need to know that components are necessary in the moment to use the functionality MAPI. Alone it is necessary to have the MAPI32.dll?.
Thank you.
|
|
|
|
|
MAPI is very much like IIS. I.e. it is part of the OS, but may or may not be installed. Bear in mind that MAPI32.dll is not redistributable and you should fail gracefully if it is not present. Various MS components such as Outlook, Office etc can install MAPI.
HTH.
|
|
|
|
|
You did use "MapiMessage", but you did not define "lpOriginator" (default).
I tried something to set the FROM("second@mymail.com") with "lpOriginator". But not successful.
Anyone know anything about it?
for example: I have two emails
first@mymail.com // default
second@mymail.com // I want to use
thanks,
larry
|
|
|
|
|
AFAIK, that field is only useful when you do a receive not a send. To change the sender address, you need to login under a different MAPI profile or configure the MAPI program to use a different sender address.
|
|
|
|
|
thanks for the info.
Can you give me a hint that I can configure the Mapi program to use a different sender address?
thanks again
|
|
|
|
|
If you have configured Outlook Express to be your MAPI provider, then use it to setup an email account, otherwise use the Mail control panel applet
|
|
|
|
|
I did use Outlook Express to setup a few accounts. But there is only one default account. My Mapi program only can use the default account to send out emails, not the others, which I want to use.
one more thing, what is Mail control panel applet?
thanks
|
|
|
|
|
See if changing the default account in OE makes a difference.
On some machines, there will be a mail icon in the control panel which allows you to create new MAPI profiles. If not use the "Internet Options" applet's Programs tab to change the program which handles MAPI.
|
|
|
|
|
thanks for all the help
larry
|
|
|
|
|
Hi there,
Is there any other way to access MAPI without having to logon to a session? Or alternatively I need to find the source of this problem...
The reason I am asking is because I've developed a custom SQL DTS task to send mail to multiple recipients. The custom task has no problem logging on to a MAPI session with a valid profile (when executing from Enterprise Manager). But as soon as I schedule the task as a Job then I can't logon to the same MAPI session.
Any ideas from the gurus outside?
|
|
|
|
|
This is related to the problem of using MAPI in a service. For more info on this consult the MSDN. For example KB Article "Q197820" has some good info on this.
|
|
|
|
|
Thanx for the prompt reply.
Regards from South Africa
|
|
|
|
|
Has anyone been able to send Group recipients with this class?
bbarbara
|
|
|
|
|
I'm using MSVC++ 6.0 in windows 2000 and I've compiled and ran CMapi. It works fine, however the send command take many seconds to return (approximately 20). I've stepped into the send function and traced the problem to the following code:
if ( if (Resolve(sName, &lpTempRecip))
{
//Resolve worked, put the resolved name back into the sName
sName = lpTempRecip->lpszName;
//Don't forget to free up the memory MAPI allocated for us
m_lpfnMAPIFreeBuffer(lpTempRecip);
}
It is the Resolve(sName, &lpTempRecip) line that takes so long to return. It also throws many "First-chance exception in cmapi.exe (KERNEL32.DLL): 0x000006BA: (no name)." errors.
Any ideas?
|
|
|
|
|
As I replied to other queries:
There are no guarantees on when delivery / time to process a request will occur / take. This is completely up to the app which is acting as the MAPI service provider e.g. Outlook Express or Outlook will decide on how and / or when to send the mails.
To avoid resolve calls being made simply set bResolve to FALSE in calls to the CMapiSession::Send method.
P.S. If you want more control over the delivery then I would suggest you look into either Extended MAPI or SMTP
|
|
|
|
|
Hello,
Can you tell me if CMapiSession::Send() blocks, or if it does its work in a thread somewhere and returns immediately? The reason I'm asking is that I'm creating a CMapiSession object and two CMapiMessage objects in a worker thread, and when I call CMapiSession::Send(), it sometimes sends both messages, and sometimes only sends the first one. The second message either doesn't get created at all (in the mail client), or ends up sitting in the outbox of the mail client (in this case, Outlook Express).
If CMapiSession::Send() is using a thread somewhere, and not blocking, then I'd understand why I'm only getting one message some of the time: my worker thread is probably completing before Send() is done with the second message. If this is the case, can you tell me if there is a way to know when Send() is done, so I can tell my thread to wait for it?
Thanks!
|
|
|
|
|
There are no guarantees on when delivery will occur. This is completely up to the app which is acting as the MAPI service provider e.g. Outlook Express or Outlook will decide on how and / or when to send the mails.
Sorry,
P.S. If you want more control over the delivery then I would suggest you look into either Extended MAPI or SMTP.
Regards,
|
|
|
|
|
Looks like just what I need! However, does this work when the user has a weird email client installed such as Eudora or Ccmail or some other thing like that?
Thanks!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
It will work with any program which is simple MAPI compliant. Last time I used ccMail (v7) it had just addedd support for MAPI. As for Eudora, you will need to contact their tech support to find out that answer.
|
|
|
|
|
Whenever i try to use this program, the outlook express dialog box appears and warn that some external program wants to send mail, do you want to continue?? When i press yes button, another dialog box appears which shows the mail send progress control. I want to get rid of both these dialog boxes. I got rid of first one from Outlook express properties. But unable to get rid of second one. Please tell me how ???
|
|
|
|