Help: How to send email from a MFC Dialog based App 
Author Message
 Help: How to send email from a MFC Dialog based App

Dear All,

Can I send email out from a Dialog based MFC app?  Thanks a lot for your
help!

Kelvin



Mon, 12 Sep 2005 19:06:04 GMT  
 Help: How to send email from a MFC Dialog based App
On Thu, 27 Mar 2003 13:06:04 -0500, "Kelvin"

Quote:

>Dear All,

>Can I send email out from a Dialog based MFC app?  Thanks a lot for your
>help!

>Kelvin

Hi,

You might want to try P.J. Naughter's Freeware MFC class:
 CSMTPConnection - an MFC Class to encapsulate the SMTP protocol  

The URL is :
http://www.naughter.com/smtp.html

It can be used in MFC applications.

Best Regards,
Yeoh
--
http://www.yeohhs.com
eBook and source code publishing



Tue, 13 Sep 2005 01:31:26 GMT  
 Help: How to send email from a MFC Dialog based App


Wed, 18 Jun 1902 01:00:00 GMT  
 Help: How to send email from a MFC Dialog based App
Hello Kelvin,

Use Mapi:

#include "mapi.h"

void CYourView::OnButton1Email()
{
    MapiMessage message ;
    MapiFileDesc attachment ;
    MapiRecipDesc recip;

    MAPISENDMAIL *lpfnMAPISendMail ;
    HMODULE hModule ;

    hModule = LoadLibrary( "mapi32.dll" ) ;
    if( hModule==NULL ) {
    printf( "ERROR: Unable to load mapi32.dll\n" ) ;
    return ;
    }

    lpfnMAPISendMail = (MAPISENDMAIL *)GetProcAddress( hModule,
"MAPISendMail" ) ;
    if( lpfnMAPISendMail==NULL ) {
    printf( "ERROR: Unable to locate MAPISendMail entry point\n" ) ;
    return ;
    }

    memset( &attachment, 0, sizeof(attachment) ) ;
    attachment.nPosition = -1 ;
    attachment.lpszPathName = szBuffer;
    memset( &recip, 0, sizeof(recip) ) ;
    recip.ulRecipClass = MAPI_TO;
    recip.lpszName = _T ("TheCompany");

    memset( &message, 0, sizeof(message) ) ;
    message.lpszNoteText = "Message Body" ;
    message.nFileCount = 1 ;
    message.lpFiles = &attachment ;
    message.lpRecips= &recip; //&recipient;
    message.nRecipCount=1;

    lpfnMAPISendMail( 0, 0, &message, MAPI_DIALOG, 0 ) ;

Quote:
}

Charles C.


Quote:
> Dear All,

> Can I send email out from a Dialog based MFC app?  Thanks a lot for your
> help!

> Kelvin



Tue, 13 Sep 2005 15:50:14 GMT  
 Help: How to send email from a MFC Dialog based App


Wed, 18 Jun 1902 01:00:00 GMT  
 Help: How to send email from a MFC Dialog based App
Hi, Yeoh,

Thanks for your help!  I'll check it out.

Regards,

Kelvin


Quote:
> On Thu, 27 Mar 2003 13:06:04 -0500, "Kelvin"

> >Dear All,

> >Can I send email out from a Dialog based MFC app?  Thanks a lot for your
> >help!

> >Kelvin

> Hi,

> You might want to try P.J. Naughter's Freeware MFC class:
>  CSMTPConnection - an MFC Class to encapsulate the SMTP protocol

> The URL is :
> http://www.naughter.com/smtp.html

> It can be used in MFC applications.

> Best Regards,
> Yeoh
> --
> http://www.yeohhs.com
> eBook and source code publishing



Tue, 13 Sep 2005 16:02:54 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Sending EMail out from MFC-APP!

2. Send Email from MFC app?

3. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

4. help sending html via email with mfc?

5. sending email from MFC dialog. (automatically send an email)

6. cannot instantiate an activex control in mfc dialog based app

7. Problem using delete with dialog-based MFC app

8. Tell me where 2 find good transparency tutorial (mfc - dialog based apps)

9. hiding an mfc dialog based app

10. I have an MFC Dialog based app...

11. dialog based MFC app. application file types

12. return a value when an MFC dialog-based app exits

 

 
Powered by phpBB® Forum Software