NetProg

 


   

NETPROG  PRESENTATION

 

  OverView
  Functionalities
  Programming
API
C Examples
  Download

 

SMTP example
C NetProg Programming
IP client server Connection Dialog Examples
TCP yes yes IP_PROTO_TCP TCP example
FTP yes no IP_PROTO_FTP FTP example
HTTP yes no IP_PROTO_HTTP HTTP example
SMTP yes no IP_PROTO_SMTP SMTP example
POP yes no IP_PROTO_POP POP example
DNS yes no IP_PROTO_DNS DNS example
DG yes yes IP_PROTO_DG USER_DEFINED example
IO          
STORE yes - IO_PROTO_STORE ANY  example
FIXED SIZE yes - IO_PROTO_FIOP  USER_DEFINED example
DATABASE          
ODBC yes - DB_PROTO_ODBC  DB example
ORACLE yes  -  DB_PROTO_ORACLE  DB example 
SQL/DS      DB_PROTO_SQLDS  DB example 

 

 

#include "mx.h" 
#include "smtp.h"


int CommandReply (MXMessage* pmessage, MXCom* pcom, void* appfield)
{
    LONG   Code     = (LONG)  MXGetValue (pmessage, "Code",     1);
    STRING Reply    = (STRING)MXGetValue (pmessage, "Reply",    1);
    LONG   Identity = (LONG)  MXGetValue (pmessage, "Identity", 1);
    STRING Value    = (STRING)MXGetValue (pmessage, "Value",    1); 
    STRING Par      = (STRING)MXGetValue (pmessage, "Par",      1);

    printf ("%d, %s, %d, %s, %s\n", Code, Reply, Identity, Value, Par);

    return 1;
}

void main ()

{

   MX mx;
   MXMessage* pmessage;

   MXInit (&mx, MXSERVER, NULL, NULL, 0, NULL);

/* Establish Connection with SMTP Server */

   SMTPCom = MXOpenTCP (&mx, "194.214.200.23", 25, IPPROTO_SMTP, NULL, NULL, TRUE);
   if (!SMTPCom) return 0;
   MXAddComCallBack (&mx, SMTPCom, SMTP_SYS, "Command_Reply", MXONRECV, CommandReply, NULL);

/* Put message in queue */

   pmessage = MXPutMessage (SMTPCom, "SMTP", "Send");

 

/* Initialize Message */


   MXSetValue (pmessage, "From",    1, "G JUREIDINI<g-jureidini@microsoft.com>"); 
   MXSetValue (pmessage, "To",      1, "ssdsds<g-jureidini@chronopost.fr>"); 
   MXSetValue (pmessage, "Cc",      1, "g-jureidini@chronopost.fr"); 
   MXSetValue (pmessage, "Bcc",     1, "g-jureidini@chronopost.fr"); 
   MXSetValue (pmessage, "Subject", 1, "SUJET"); 
   MXSetValue (pmessage, "Object", 1, "ceci est un test de texte avec retour");
   MXSetValue (pmessage, "Attachment",1, "d:/projects/vnad/sc32/Debug/system.sc");


   MXDispatchEvents (&mx, 0);

   MXEnd (&mx);

}

 

 

This site is best viewed with
Microsoft Internet Explorer 5.01 5.01 5.01 5.01 5.01 5.01