On Tuesday 24 August 2010 15:45:26 Harshdeep Singh wrote:
> Hi,
>    I am writing a program to send email to a gmail account using SMTP. I am
> specifying the username and password for the senders email id it is showing
> syntax error. 
syntax error?

> < 530 5.7.0 Must issue a STARTTLS command first. 23sm130641wfa.10
> * Access denied: 530
The mail server told you to use TLS. :-)

So try the curl flags --ssl or --ssl-reqd. 

If that works set CURLOPT_USE_SSL to CURLUSESSL_TRY or CURLUSESSL_ALL.
(See  http://curl.haxx.se/libcurl/c/curl_easy_setopt.html,
even this option is filed as FTP option it should work with other protocols
too, if I remeber correctly...)  

> Please help and how can we set the headers like subject , body etc for our
> mail.
Message generation is not a job of curl.  Either build
the message by your self (read the RFC) or find a library for that,
I'm not aware of any C library (only Perl, Java and PHP). 

Greetings,
Dirk M


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to