Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCreateThread Pin
john56329-Oct-13 1:43
john56329-Oct-13 1:43 
AnswerRe: CreateThread Pin
Freak309-Oct-13 2:06
Freak309-Oct-13 2:06 
AnswerRe: CreateThread Pin
Richard Andrew x649-Oct-13 4:08
professionalRichard Andrew x649-Oct-13 4:08 
AnswerRe: CreateThread Pin
CPallini9-Oct-13 21:31
mveCPallini9-Oct-13 21:31 
QuestionHow to let the windows show top most? Pin
yu-jian8-Oct-13 4:24
yu-jian8-Oct-13 4:24 
SuggestionRe: How to let the windows show top most? Pin
Albert Holguin8-Oct-13 5:39
professionalAlbert Holguin8-Oct-13 5:39 
QuestionDigital signature in mail message created using MAPI Pin
Turosik7-Oct-13 4:17
Turosik7-Oct-13 4:17 
AnswerRe: Digital signature in mail message created using MAPI Pin
rashin ghodratzade7-Oct-13 5:36
rashin ghodratzade7-Oct-13 5:36 
SQL
Digital signature prevents email content is faked or changed in transport level. Encrypting email protects email content from exposure to inappropriate recipients. Both digital signature and email encrypting depend on digital certificate.

If you have an email digital signature certificate installed on your machine, you can find it in Control Panel-interner option-content-Certificates-Personal
Then you can use your email certificate to sign the email by the following code. If you don't have a certificate for your email address, you MUST get a digital certificate for personal email protection from third-party certificate authorities such as www.verisign.com.
#include "stdafx.h"

#include "easendmailobj.tlh"
using namespace EASendMailObjLib;

int _tmain(int argc, _TCHAR* argv[])
{
    ::CoInitialize( NULL );

    IMailPtr oSmtp = NULL;
    oSmtp.CreateInstance( "EASendMailObj.Mail");
    oSmtp->LicenseCode = _T("TryIt");
    
    // Set your sender email address
    oSmtp->FromAddr = _T("test@emailarchitect.net");
    
    // Add recipient email address
    oSmtp->AddRecipientEx( _T("support@emailarchitect.net"), 0 );
    
    // Set email subject
    oSmtp->Subject = _T("email from Visual C++ with digital signature(S/MIME)");
    
    // Set email body
    oSmtp->BodyText = _T("this is a test email sent from Visual C++ with digital signature");
    
    // Your SMTP server address
    oSmtp->ServerAddr = _T("smtp.emailarchitect.net");
    
    // User and password for ESMTP authentication, if your server doesn't 
    // require User authentication, please remove the following codes.
    oSmtp->UserName = _T("test@emailarchitect.net");
    oSmtp->Password = _T("testpassword");

    // If your SMTP server requires SSL connection, please add this line
    //oSmtp->SSL_init();

    // Add signer digital signature
    if( oSmtp->SignerCert->FindSubject(_T("test@emailarchitect.net"), 
        CERT_SYSTEM_STORE_CURRENT_USER , _T("my")) == VARIANT_FALSE )
    {
        _tprintf(_T("Error with signer certificate; %s\r\n"), 
            (const TCHAR*)oSmtp->SignerCert->GetLastError());
        return 0;
    }

    if( oSmtp->SignerCert->HasPrivateKey == VARIANT_FALSE )
    {
        _tprintf(_T("certificate does not have a private key, it can not sign email.\r\n" )); 
        return 0;			
    }

    _tprintf(_T("Start to send email ...\r\n" ));
  
    if( oSmtp->SendMail() == 0 )
    {
        _tprintf( _T("email was sent successfully!\r\n"));
    }
    else
    {
        _tprintf( _T("failed to send email with the following error: %s\r\n"),
            (const TCHAR*)oSmtp->GetLastErrDescription());
    }

    if( oSmtp != NULL )
        oSmtp.Release();

    return 0;
}

Question[C/C++] Parse multipart/form-data POST request in a small web server Pin
csrss6-Oct-13 21:29
csrss6-Oct-13 21:29 
AnswerRe: [C/C++] Parse multipart/form-data POST request in a small web server Pin
csrss7-Oct-13 23:15
csrss7-Oct-13 23:15 
QuestionGMP and Windows Pin
BobInNJ5-Oct-13 11:01
BobInNJ5-Oct-13 11:01 
AnswerRe: GMP and Windows Pin
pasztorpisti5-Oct-13 11:58
pasztorpisti5-Oct-13 11:58 
GeneralRe: GMP and Windows Pin
rashin ghodratzade7-Oct-13 6:05
rashin ghodratzade7-Oct-13 6:05 
QuestionFind URL Pin
john56324-Oct-13 19:41
john56324-Oct-13 19:41 
AnswerRe: Find URL Pin
Richard MacCutchan4-Oct-13 20:43
mveRichard MacCutchan4-Oct-13 20:43 
AnswerRe: Find URL Pin
jschell5-Oct-13 10:46
jschell5-Oct-13 10:46 
AnswerRe: Find URL Pin
Albert Holguin8-Oct-13 5:43
professionalAlbert Holguin8-Oct-13 5:43 
QuestionCapturing all Keyboard input using a DLL Pin
Don Guy4-Oct-13 10:11
Don Guy4-Oct-13 10:11 
AnswerRe: Capturing all Keyboard input using a DLL Pin
jeron14-Oct-13 10:31
jeron14-Oct-13 10:31 
AnswerRe: Capturing all Keyboard input using a DLL Pin
rashin ghodratzade7-Oct-13 6:22
rashin ghodratzade7-Oct-13 6:22 
AnswerRe: Capturing all Keyboard input using a DLL Pin
vijith.squadz9-Oct-13 1:30
professionalvijith.squadz9-Oct-13 1:30 
QuestionEncode audio from .wav to .aac Pin
CodingHell4-Oct-13 0:33
CodingHell4-Oct-13 0:33 
AnswerRe: Encode audio from .wav to .aac Pin
jeron14-Oct-13 5:19
jeron14-Oct-13 5:19 
GeneralRe: Encode audio from .wav to .aac Pin
CodingHell6-Oct-13 20:03
CodingHell6-Oct-13 20:03 
QuestionRe: Encode audio from .wav to .aac Pin
jeron17-Oct-13 3:57
jeron17-Oct-13 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.