* How to send mail from C program on Linux
@ 2009-10-28 12:09 darshan.ghumare
2009-10-28 13:36 ` Nicholas Mc Guire
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: darshan.ghumare @ 2009-10-28 12:09 UTC (permalink / raw)
To: linux-c-programming
Hi,
In my project I need to send mail on Linux.
I have used sendmail to send mail but there are failed to send mail to my gmail account.
Thanks In advance
Regards
Darshan
--
This message was sent on behalf of darshan.ghumare@gmail.com at openSubscriber.com
http://www.opensubscriber.com/messages/linux-c-programming@vger.kernel.org/topic.html
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: How to send mail from C program on Linux
2009-10-28 12:09 How to send mail from C program on Linux darshan.ghumare
@ 2009-10-28 13:36 ` Nicholas Mc Guire
2009-10-28 14:31 ` Javier Martinez Canillas
2009-10-28 13:43 ` vinit dhatrak
2009-10-28 21:35 ` Glynn Clements
2 siblings, 1 reply; 5+ messages in thread
From: Nicholas Mc Guire @ 2009-10-28 13:36 UTC (permalink / raw)
To: darshan.ghumare; +Cc: linux-c-programming
On Wed, 28 Oct 2009, darshan.ghumare@gmail.com wrote:
> Hi,
>
> In my project I need to send mail on Linux.
> I have used sendmail to send mail but there are failed to send mail to my gmail account.
>
well there is always ugly insecure brute force:
#include <stdlib.h>
#include <stdio.h>
int main(int argc,char ** argv){
char cmd[128];
sprintf(cmd,"/usr/bin/mail -v root < /tmp/mail");
system(cmd);
return 0;
}
hofrat
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: How to send mail from C program on Linux
2009-10-28 12:09 How to send mail from C program on Linux darshan.ghumare
2009-10-28 13:36 ` Nicholas Mc Guire
@ 2009-10-28 13:43 ` vinit dhatrak
2009-10-28 21:35 ` Glynn Clements
2 siblings, 0 replies; 5+ messages in thread
From: vinit dhatrak @ 2009-10-28 13:43 UTC (permalink / raw)
To: darshan.ghumare; +Cc: linux-c-programming
On Wed, Oct 28, 2009 at 5:39 PM, <darshan.ghumare@gmail.com> wrote:
> Hi,
>
> In my project I need to send mail on Linux.
> I have used sendmail to send mail but there are failed to send mail to my gmail account.
>
> Thanks In advance
>
> Regards
> Darshan
>
> --
> This message was sent on behalf of darshan.ghumare@gmail.com at openSubscriber.com
> http://www.opensubscriber.com/messages/linux-c-programming@vger.kernel.org/topic.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Hi Darshan,
Does sendmail works from command prompt? Can you post your code so
that exact problem can be located?
-Vinit
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to send mail from C program on Linux
2009-10-28 12:09 How to send mail from C program on Linux darshan.ghumare
2009-10-28 13:36 ` Nicholas Mc Guire
2009-10-28 13:43 ` vinit dhatrak
@ 2009-10-28 21:35 ` Glynn Clements
2 siblings, 0 replies; 5+ messages in thread
From: Glynn Clements @ 2009-10-28 21:35 UTC (permalink / raw)
To: darshan.ghumare; +Cc: linux-c-programming
darshan.ghumare@gmail.com 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
compatibility.
> 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
forever.
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
immediately.
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-28 21:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-28 12:09 How to send mail from C program on Linux darshan.ghumare
2009-10-28 13:36 ` Nicholas Mc Guire
2009-10-28 14:31 ` Javier Martinez Canillas
2009-10-28 13:43 ` vinit dhatrak
2009-10-28 21:35 ` Glynn Clements
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).