Results 1 to 11 of 11

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426

    undisclosed-recipients"

    . :
    From: adres na izprashtacha
    : undisclosed-recipients

    .
    EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2

  2. #2
    Wall-e delian's Avatar
    Join Date: May:2003
    Location: ::1
    Posts: 4,723
    "To:" "Bcc". , .

  3. #3
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426
    #define MAILSTR_MAX_LEN 128
    char MyMail[MAILSTR_MAX_LEN];
    char OtherMail[MAILSTR_MAX_LEN];
    #define MAILADDRESS "mymail@mymail.bg"
    #include <stdio.h>
    #include <winsock.h>
    #include <stdlib.h>

    void DieWithError(char*errorMessage) { fprintf(stderr,"%s:%d\n", errorMessage,WSAGetLastError()); exit(1); }

    void main(int argc,char*argv[])
    {
    int sock;
    struct sockaddr_in echoServAddr;
    unsigned short echoServPort;
    char *servIP;
    char echoString[100];
    char echoBuffer[100];
    int echoStringLen;
    int bytesRcvd,totalBytesRcvd;
    WSADATA wsaData;
    servIP="xxx.xxx.xxx.xxx";
    echoServPort=25;

    if(WSAStartup(MAKEWORD(2,0),&wsaData)!=0 )
    {
    fprintf(stderr,"WSAStartup()failed");
    exit(1);
    }

    strcpy (MyMail, "m@b.com");
    strcpy (OtherMail, MAILADDRESS);

    if((sock=socket(PF_INET,SOCK_STREAM,IPPR OTO_TCP))<0)
    DieWithError("socket()failed");
    memset(&echoServAddr,0,sizeof(echoServAd dr));
    echoServAddr.sin_family=AF_INET;
    echoServAddr.sin_addr.s_addr=inet_addr(s ervIP);
    echoServAddr.sin_port=htons(echoServPort );

    if(connect(sock,(struct sockaddr*)&echoServAddr,sizeof(echoServA ddr))<0)
    DieWithError("connect()failed");

    strcpy(echoString,"helo proba \r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    totalBytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString, "MAIL FROM: <%s>\r\n", MyMail);
    printf (echoString);
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString, "RCPT TO: %s\r\n", OtherMail);
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString, "DATA \r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString,"From: aaa@aaa.bg \r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString,"To: aaa@aaa.bg \r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString,"Subject: \r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);


    sprintf (echoString,"%s\r\n",argv[1]);
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString,"\r\n.\r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);

    sprintf (echoString,"quit\r\n");
    echoStringLen=strlen(echoString);

    if(send(sock,echoString,echoStringLen,0) !=echoStringLen)
    DieWithError("send()sent a different number of bytes than expected");
    bytesRcvd=0;
    printf("Received:");

    if((bytesRcvd=recv(sock,echoBuffer,100,0 ))<=0)
    DieWithError("recv()failed or connection closed prematurely");
    echoBuffer[bytesRcvd]='\0';
    printf(echoBuffer);


    }
    M ?
    EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2

  4. #4
    Wall-e delian's Avatar
    Join Date: May:2003
    Location: ::1
    Posts: 4,723
    ?
    WINSOCK.H, , !

    - -
    Last edited by delian; 10th June 2003 at 13:56.

  5. #5
    Wall-e delian's Avatar
    Join Date: May:2003
    Location: ::1
    Posts: 4,723
    , . :
    sprintf (echoString, "RCPT TO: %s\r\n", OtherMail);
    :
    sprintf (echoString, "RCPT TO:<%s>\r\n", OtherMail);

  6. #6
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426
    Visual C 6.0. console application. settings wsock32.lib
    EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2

  7. #7
    Wall-e delian's Avatar
    Join Date: May:2003
    Location: ::1
    Posts: 4,723
    ?

  8. #8
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426
    EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2

  9. #9
    Wall-e delian's Avatar
    Join Date: May:2003
    Location: ::1
    Posts: 4,723
    - .

    , .

  10. #10
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426
    exe - . .
    EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2

  11. #11
    Wall-e delian's Avatar
    Join Date: May:2003
    Location: ::1
    Posts: 4,723
    -.

    : , -. -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |