Re: How to send mail from C program on Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


darshan.ghumare@xxxxxxxxx wrote:

> In my project I need to send mail on Linux.

Use "sendmail" (historically /usr/lib/sendmail, although
/usr/sbin/sendmail is common on Linux). MTAs other than sendmail
normally provide a script or program named "sendmail" for

> I have used sendmail to send mail but there are failed to send mail to my gmail account.

You need to look into *why* the message wasn't received.

The first thing to check is that the daemon is running. Otherwise, the
message will be placed in the outbound mail queue and stay there

If it's because either gmail or your ISP insist that you send mail via
their SMTP server, then configure your mail server to do so (the
details depend upon the particular software).

Alternatively, your program could speak SMTP directly to a specified
server, but that will fail if either the mail server or your internet
connection is down at the point that the program tries to send mail. 
Running a local MTA eliminates this problem; the program will always
be able to send the message, even if it cannot be delivered

Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux