一点也不用VCL?
那你最好别用Delphi了,用ASP什么的弄个脚本就行了
:p

解决方案 »

  1.   

    pdsinfo,你到底懂不懂啊?
    用WINSOCK直接发邮件我会,就是不知附件怎么发
      

  2.   

    在procedure TfrmMain.lvMessagePartsClick(Sender: TObject);
    里面:
    TIdAttachment(Msg.MessageParts.Items[i]).SaveToFile(SaveDialog1.FileName);
      

  3.   

    WSADATA wsa; 
    CString res,str; 
    WSAStartup(0x0101,&wsa); 
    struct sockaddr_in addr; 
    SOCKET s; 
    struct hostent* p=gethostbyname(smtp.etang.com);//prase Domain to IP 
    if(!p){ 
    pc->m_status+="\r\nError get IP."; 
    pc->GetDlgItem(IDC_STATUS)->SetWindowText(pc->m_status); 
    goto out; 

    s=socket(AF_INET,SOCK_STREAM,0); 
    addr.sin_family=AF_INET; 
    addr.sin_port=htons(25); 
    addr.sin_addr.s_addr = *(unsigned long*)p->h_addr; 
    if(connect(s,(struct sockaddr*)&addr,sizeof(addr))==SOCKET_ERROR){ 
    pc->m_status+="\r\nError in connect to smtp server."; 
    goto out; 

    str="HELO "+pc->m_Server+"\r\n";//Say HELLO to SMTP Server. 
    if(send(s,(LPCSTR)str,str.GetLength(),0)==SOCKET_ERROR){ 
    pc->m_status+="\r\nError in send HELO command."; 
    goto out; 
    } recv(s,res.GetBufferSetLength(INFOLEN),INFOLEN,0); 
    pc->m_status+="\r\n"+res; 
    str="MAIL From: <"[email protected]+">\r\n";//Tell the sender of this mail. 
    if(send(s,(LPCSTR)str,str.GetLength(),0)==SOCKET_ERROR){ 
    pc->m_status+="\r\nError in MAIL FROM command"; 
    goto out; 

    res.Empty(); 
    recv(s,res.GetBufferSetLength(INFOLEN),INFOLEN,0); 
    pc->m_status+="\r\n"+res; 
    str="RCPT TO: <"+pc->m_To+">\r\n";// 
    if(send(s,(LPCSTR)str,str.GetLength(),0)==SOCKET_ERROR){ 
    pc->m_status+="\r\nError in RCPT TO command"; 
    //pc->GetDlgItem(IDC_STATUS)->SetWindowText(pc->m_status); 
    goto out; 

    res.Empty(); 
    recv(s,res.GetBufferSetLength(INFOLEN),INFOLEN,0); 
    pc->m_status+="\r\n"+res; 
    str="DATA\r\n";//Start to transfer mail body. 
    if(send(s,(LPCSTR)str,str.GetLength(),0)==SOCKET_ERROR){ 
    pc->m_status+="\r\nError in DATA command"; 
    goto out; 

    res.Empty(); 
    recv(s,res.GetBufferSetLength(INFOLEN),INFOLEN,0); 
    pc->m_status+="\r\n"+res; 
    if(send(s,(LPCSTR)pc->m_Content,pc->m_Content.GetLength(),0)==SOCKET_ERROR){ 
    pc->m_status+="\r\nError in send mail body"; 
    goto out; 
    } res.Empty(); 
    recv(s,res.GetBufferSetLength(INFOLEN),INFOLEN,0); 
    pc->m_status+="\r\n"+res; 
    send(s,"\r\n.\r\n",5,0); 
    str="VRFY "+pc->m_query+"\r\n"; 
    send(s,str,str.GetLength(),0); 
    res.Empty(); 
    recv(s,res.GetBufferSetLength(INFOLEN),INFOLEN,0); 
    res="HELP"; 
    send(s,res.GetBuffer(res.GetLength()),res.GetLength(),0); 
    res.Empty(); 
    recv(s,res.GetBufferSetLength(300),300,0); send(s,"QUIT\r\n",6,0); 
    closesocket(s); 
    WSACleanup(); out: 
    pc->GetDlgItem(IDC_BTNSTOP)->EnableWindow(FALSE); 
    pc->GetDlgItem(IDC_BTNSEND)->EnableWindow(TRUE); 
      

  4.   

    不好意思,发错了。
    这个问题好像应该可以用ShellExecute(……,mailto:……)
    具体请看
    http://msdn.microsoft.com/library/en-us/dnfoxtk00/html/ft00h12.asp?frame=true