Use VC to send Mail could be very complicated if you programe it yourself
using MAPI!
However there are some share classes on internet that you could use !
You could download it ,and analyse it ,then to use it .You had better make sure
you understand the code before you use it !
I have one which is displayed below.However I couldn't give it to here!========================================================================
       ATL COM Object : SimpleEmailClientX 1.3
========================================================================Author: Emmanuel KARTMANN <[email protected]>
Creation Date: November 28th, 1998
Last Modification Date: February 8th, 2000OVERVIEW
========This ATL COM component provides very simple Internet email functionality (SMTP).FEATURES
========    * implement the basics of SMTP, as defined in RFC821 and RFC822
    * send plain text email: no attachements, no MIME encoding.
    * support multiple recipients (separate email addresses with commas ',')
    * support multiple email servers (try next server if email cannot be delivered to a server)
NEW * provides automatic detection of SMTP server (resolve MX record in the DNS, using COMponent SimpleDNSResolver)
    * provide extended error information (ISupportErrorInfo and IErrorInfo are implemented)
    * provide very small executable: 44 Ko (MinSize) to 144 Ko (MinDependency)
    * require no Graphical User Interface: the component can be used in non-GUI applications, 
      like a Windows NT Service.
* run on Windows NT 4.0, Windows 95 and Windows 98
* compile with VC++ 6.0 SP3USAGE
=====To use this component:
    * create an instance of the component,
    * call method SendEmail from interface ISimpleEmailClientX,
    * handle errors (try/catch in C++)SAMPLE CODE (VC++)
==================    // Import smart pointer definition
    #import "SimpleEmailClient.dll" no_namespace    // Create smart pointer object
    ISimpleEmailClientXPtr pSimpleEmailClientX;    // =======================================================================
// Initialize COM (This should be called at thread startup)
    // =======================================================================
    HRESULT hResult = CoInitialize(NULL); 
    if (FAILED(hResult)) {
        ErrorDialogBox("Cannot initialize COM: \n", hResult);
        return; // Failed
    }

    // =======================================================================
// Create instance of the component to test
    // =======================================================================
    try 
    {
        HRESULT hResult = S_OK;
        // Create object
        hResult = pSimpleEmailClientX.CreateInstance("Emmanuel.SimpleEmailClientX.1");
        if (FAILED(hResult)) {
            ErrorDialogBox("Cannot create component Emmanuel.SimpleEmailClientX.1: \n", hResult);
        }
    }
    catch (_com_error &e)
    {
        ErrorDialogBox("Cannot create component Emmanuel.SimpleEmailClientX.1: \n", e);
    }    // =======================================================================
    // Call method of component
    // =======================================================================
    try 
    {
        HRESULT hResult = S_OK;
        hResult = pSimpleEmailClientX->SendEmail(_bstr_t(m_szFrom), _bstr_t(m_szTo), _bstr_t(m_szSubject), _bstr_t(m_szBody), _bstr_t(m_szServerName));
        if (FAILED(hResult)) {
            ErrorDialogBox("Failure while executing method SendMail: \n", hResult);
        }
    }
    catch (_com_error &e)
    {
        ErrorDialogBox("Failure while executing method SendMail: \n", e);
    }    // =======================================================================
    // UnInitialize COM (This should be called at thread exit)
    // =======================================================================
    CoUninitialize(); 
Please refer to the test project in subdirectory "TestSimpleEmailClient" for a full example.SAMPLE CODE (VBScript)
====================== Dim oSMTP Set oSMTP = CreateObject("Emmanuel.SimpleEmailClientX.1") oSMTP.SendEmail "[email protected]", "[email protected]", "My Subject", "My Text...", "myserver.domain.com"
Please refer to the test HTML file for a full VBSsript example :
    TestSimpleEmailClient/TestSimpleEmailClient.htmIMPLEMENTATION
==============This component relies on two MFC-related C++ class:
    * CSimpleSocket: an extension of MFC class CSocket providing text and timer features
    * CSimpleSMTPClient: a C++ class implementing a SMTP client.You can integrate these classes in your application if you don't want to use the component.If the COMponent "Emmanuel.SimpleDNSClient" is installed on your machine, it will be used
to find the name of you SMTP server(s) as registered in the DNS. You will not need to provide
a SMTP name as the 5th parameter of method SendEmail (just put an empty string). Please refer 
to the SimpleDNSClient documentation (www.kartmann.com/emmanuel) for details.
TO DO LIST
==========    * Support attachments
    * Support binary data (MIME encoding)
* Support additional SMTP headers (Reply-To, Cc, Bcc, etc...)
* Support ESMTP

解决方案 »

  1.   

    [email protected],
    能给我一份吗?
      

  2.   

    如果用delphi通过smtp身份验证发送含有附件的mail,我几分钟就搞定了
      

  3.   

    [email protected]
    我真的很急需。无论是VC或DELPHI都行。
    多谢了
      

  4.   

    >[email protected]发出! 
      

  5.   

    ???? chinaren的信箱进不去??
    麻烦 prog_st老兄再发一份   [email protected]
    双倍分
      

  6.   

    [email protected]
    最好是VC的,多谢!!!
      

  7.   

    来得很晚,但希望能给我一份源代码!
    [email protected]
      

  8.   

    希望我不是最晚的。
    [email protected]
    谢谢!
      

  9.   

    [email protected]发出!