#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);
}
|