Email Sender

Jun 11, 2012 at 5:18am
closed account (LAfSLyTq)
how do i make a program that sends emails via smtp server (gmail or others)?
Jun 11, 2012 at 11:57am
It's not to hard to implement it yourself. You need sockets, connect and a few line of conversation. That's it:

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
Jun 11, 2012 at 12:30pm
Got this , you would be sending mail through gmail's smtp server (smtp.gmail.com). The client would need to support SSL or TLS in order to connect.

Msmtp - http://msmtp.sourceforge.net/

libESMTP - http://www.stafford.uklinux.net/libesmtp/

Those both support SSL/TLS and should work great with gmail. The settings to send outbound mail with gmail would be:

Outgoing Mail (SMTP) Server (requires TLS or SSL): smtp.gmail.com
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465
Account Name: your full email address (including @gmail.com or @your_domain.com)
Email Address: your email address (username@gmail.com or username@your_domain.com)
Password: your Gmail password


Refer http://mail.google.com/support/bin/answer.py?hl=en&answer=13287
Jun 11, 2012 at 4:55pm
closed account (LAfSLyTq)
what i dont understand is that i can make a easy email sender in visual basic but in c++ i need all of this stuf... i think ill stick with visual basic on this one =[
Jun 11, 2012 at 5:37pm
Visual basic has the .net libraries which brings access to ALOT of functionality c++ doesn't have without external libraries. I personally detest VB and would recommend c# but to each his own.
Jun 11, 2012 at 5:55pm
Agreed, naraku9333. .NET is a powerful set of resources for a Windows developer, but I'd much rather use it in a C-family language like C#...
Jun 11, 2012 at 9:55pm
You can also use c++\cli - you will basically use the exact same function calls you would in vb or c#, just in c++/cli syntax.

I think the original purpose for c++/cli was to aid with migration from native to managed, but have personally seen implementations of mix mode c++/cli solutions where the main aim was for native c++ but easily interfaced with any managed component that a c# or vb app could interface with.

Some of these native components performing fairly stressful tasks were also easily wrapped in a managed wrappers such that .NET assemblies was produced which was easily used by the c# or vb developers.

Basically there are situations where running native is going to be far more superior that running with managed code.

Such systems can also be changed in the long run (via SOA principals) to migrate the native c++ components to linux while still interfacing to services in windows that interface with the required set of .NET components. Implementing a system completely in c# or vb will usually restrict you to the windows environment only.
Topic archived. No new replies allowed.