Send Email using C++

Hi I'm using Dev C++ and am trying to figure out how to send an email from it. I've searched all over the internet but found nothing. Does anyone here know how? I'm using gmail if it helps. Thanks
You're looking for an smtp library. There are many.
I've tried to use some and can't seem to get it working. Any suggestions?
show us what you have got so far ?
Right now? Nothing. Everything I do either won't compile, or won't send an email.
Yeah show us the code that either won't compile, or won't send an email please.
Here it is: I'm sure I'm doing something very wrong. This is the only one which compiles however.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<iostream>
#include<fstream>
#include<conio.h>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <winable.h>
#include <cmath>
#include<string>
using namespace std;

int main(){
FILE *email= popen( "/usr/lib/sendmail", "wb" );

fprintf( email, "To: xxxxxxx@xxxxxxx.com\r\n" );
fprintf( email, "From: xxxxxx@xxxxxx.com\r\n" );
fprintf( email, "\r\n" );
fprintf( email, "Hello!\r\n" );

pclose( email );
system("pause");
return 0;
}
Okay I don't know about SMTP libraries but you're program does nothing network-related!
all the piece of code does is to write those strings to a file.
nothing network-related indeed.

here is an example
http://stackoverflow.com/questions/58210/c-smtp-example

hope that helps
Topic archived. No new replies allowed.