Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Ads

Discussion Groups

Discussion Groups | Rabbit-Semi | SMTP IP Resolve

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

SMTP IP Resolve - Omar - Aug 6 5:55:20 2008

Hello:
I'm ussing this rutine to sends an e-mail

//---------------------------------------------------------------------
void SendMensPrueba()
//---------------------------------------------------------------------
{
char BodyMens[20];
char DirSep[71];
while (isCoRunning(&cSendMail)==1){

}

strcpy(BodyMens,"Mensaje de Prueba");
strcpy(DirSep,config.wDestMensCrit);

#ifdef USE_SMTP_AUTH
smtp_setauth (config.wsmtpcuentaval,config.wsmtppass);
#endif

smtp_setserver(config.wsmtpsrvr);
direnvio=strtok(DirSep, ";");

while (direnvio!=NULL) {

smtp_sendmail(direnvio,config.wsmtpmailfrom,config.wAsunto,BodyMens);

while(smtp_mailtick()==SMTP_PENDING){
}

if(smtp_status()==SMTP_SUCCESS){
printf("\n\r\Message sent\n\r");
strcpy(wMailStatus," Ultimo e-mail enviado OK ");
}else{
strcpy(wMailStatus," Ultimo e-mail con errores ");

if(smtp_status()==SMTP_UNEXPECTED)
printf("\n\r\Error INESPERADO \n\r");
else
printf("\n\r\Error sending message\n\r");
}
direnvio=strtok(NULL, ";");

}
}

It works very whell, . It send an e-mail to all address writed into
direnvio (separated by ;).
But I can not use a name (smtp.mailserver.com.ar for example) in the
smtp field (config.wsmtpsrvr). I need use an IP address.

I have configurated the lan parameters with.

ifconfig(IF_ETH0, IFS_IPADDR, aton(config.wdirip),
IFS_NETMASK, aton(config.wmask),
IFS_ROUTER_SET, aton(config.wrouter),
IFS_NAMESERVER_SET, aton(config.wdnssrvr),
IFS_UP,
IFS_END);

All config.xxx parameters are char variables and work whell.

Why the name for smtp is not resolved ? Have you some idea.
I have test this configuration in anothers lans with the same results.

Thank you in advance.
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )