# Sample smtp mail

**URL:** <https://forums.digi.com/t/sample-smtp-mail/10996>\
**Category:** Rabbit\
**Created:** [April 16, 2012, 2:28pm UTC](https://forums.digi.com/t/sample-smtp-mail/10996 "2012-04-16T14:28:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rems](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@rems](https://forums.digi.com/u/rems)\
**Post date:** [April 16, 2012, 2:28pm UTC](https://forums.digi.com/t/sample-smtp-mail/10996/1 "2012-04-16T14:28:59Z")

</div>

hello I’m using the sample of DCRAbbits10.66 smtp with rcm5700 and I would like sent an email from hotmail by rabbit I did not know how to configure smtp verbose. thank you for your help

c code:  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
smtp.c  
Rabbit Semiconductor, 2000

```
    A small program that uses the SMTP library
    to send an e-mail.

```

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
#class auto

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- Configuration \*
- ------------- \*
- All fields in this section must \*
- be altered to match your local \*
- network settings. \*  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

/\*

- NETWORK CONFIGURATION
- Please see the function help (Ctrl-H) on TCPCONFIG for instructions on
- compile-time network configuration.  
\*/  
#define TCPCONFIG 1  
#define \_PRIMARY\_STATIC\_IP “172.18.24.51”  
#define \_PRIMARY\_NETMASK “255.255.252.00”  
#define MY\_GATEWAY “0.0.0.0”  
#define MY\_NAMESERVER “0.0.0.0”

#define SUBJECT “salut beau gosse!”  
#define BODY "sa marche !.  
"   
“t’es t’es trop fort!”

#define SMTP\_FROM “[rem--s@hotmail.fr](mailto:rem--s@hotmail.fr)”  
#define SMTP\_TO “[rem--s@hotmail.fr](mailto:rem--s@hotmail.fr)”

//#define SMTP\_SERVER “10.10.6.1”  
#define SMTP\_SERVER “[smtp.live.com](http://smtp.live.com)”

#define SMTP\_PORT 25

#define SMTP\_DOMAIN “[hotmail.fr](http://hotmail.fr)”

#define SMTP\_VERBOSE

#define USE\_SMTP\_AUTH  
#define SMTP\_AUTH\_USER “[yop@mail.com](mailto:yop@mail.com)”  
#define SMTP\_AUTH\_PASS “\*\*\*\*\*\*\*\*\*\*\*\*\*”

#define SMTP\_AUTH\_FAIL\_IF\_NO\_AUTH

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- End of configuration section \*  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

#ifndef SMTP\_SERVER  
#error “You must define SMTP\_SERVER to your server’s IP or hostname.”  
#endif  
#ifndef SMTP\_FROM  
#error “You must define SMTP\_FROM to a valid email address.”  
#endif  
#ifndef SMTP\_TO  
#error “You must define SMTP\_TO to your email address.”  
#endif

#memmap xmem  
#use dcrtcp.lib  
#use smtp.lib

void main()  
{  
// Start network and wait for interface to come up (or error exit).  
sock\_init\_or\_exit(1);

#ifdef USE\_SMTP\_AUTH  
smtp\_setauth (SMTP\_AUTH\_USER, SMTP\_AUTH\_PASS);  
#endif

```
smtp_sendmail(SMTP_TO, SMTP_FROM, SUBJECT, BODY);

while(smtp_mailtick()==SMTP_PENDING)
	continue;

if(smtp_status()==SMTP_SUCCESS)
	printf("Message sent

```

");  
else  
printf("Error sending message  
");  
}
