Re: SMTP library??



On a sunny day (Thu, 31 Aug 2006 11:23:44 GMT) it happened zentara
<zentara@xxxxxxxxxxxxxx> wrote in
<aghdf29m1tcbifi4gh8ckhp04vaq9njmih@xxxxxxx>:

On 30 Aug 2006 08:57:41 -0700, akhodakivskiy@xxxxxxxxx wrote:

Hi

I am looking for an SMTP library for linux which will allow me to send
emails to the smtp server.
I dont need an smtp server or whatevam I need to write only client
side part.

Any suggestions?

And I will mention the Perl modules

http://search.cpan.org/search?query=Net%3A%3ASMTP&mode=all

http://search.cpan.org/search?query=Net%3A%3ASMTP_auth&mode=all


Mmm, wanted to post this, then was too much work to do full detail,
but in essence you can just write to sendmail:

Basicaly an email minimum has:
some headers:
a blank line separating headers and text,
the text,
a line with only one '.' to indicate the end of text.


The sequence then becomes something like this:

char *message_text; // must be allocated
char temp[80];
FILE *sendmail_filefd;

/* create a filedescriptor to be able to talk to sendmail */
sprintf(temp, "sendmail -oc -t -oem -odb -oi");
sendmail_filefd = popen(temp, "w");
if! sendmail_fd)
{
/* error report */

return SUCKS;
}

/*
write the headers,
you should use variables of course for from, to, date, and subject.
*/

fprintf(sendmail_fd, "From: Jan Panteltje <pNaonStpealmtje@xxxxxxxxx>");
if(ferror(sendmail_filefd) )
{
fprintf(stderr, "could not write to sendmail, aborting.\n");

return SUCKS;
}

fprintf(sendmail_fd, "To: <example@xxxxxxxxxxx>\n");
/* error check after each write !! */

fprintf(sendmail_fd, "Subject: split a /path/filename into components\n");
fprintf(sendmail_fd, "Date: Thu, 31 Aug 2006 10:37:20 GMT\n");
fprintf(sendmail_fd, "Mime-Version: 1.0\n");
fprintf(sendmail_fd, "Content-Transfer-Encoding: 8bit\n");
fprintf(sendmail_fd, "Content-Type: text/plain; charset=ISO-8859-15\n");

/* a blank line separates header and body */
fprintf(sendmail_filefd, "\n");

/* the message text */
fprintf(sendmail_fd, "%s", message_text);

/* a single period on a line indicates end of text */
fprintf(sendmail_filefd, ".\n");

pclose(sendmail_fd);

return PARTY;

.



Relevant Pages

  • Re: can I verify the source of my email?
    ... > I have received several emails from a trusted friend and ... > if all these emails were originated on the same computer. ... Look at the full headers of the message and inspect the Received ... to the SMTP server, and which you don't get to see). ...
    (microsoft.public.internet.mail)
  • Re: exchange problems
    ... You will want a backup SMTP server. ... Perhaps your ISP will agree to do this. ... Make sure your virtual SMTP server is configured correctly. ... > My problem is that although I can send emails from Exchange when I send ...
    (microsoft.public.windows.server.sbs)
  • Re: SMTP relay accepted domains
    ... I'm not sure if I understand your question correctly, but the only thing that the 'accepted domains' configuration in Exchange 2007 does, is tell the SMTP server what domains are handled internally by the Exchange servers. ... Currently we are running on Exchange 2003 sp2, we use a 3rd party company in order to send marketing email to cutomers, we delegate one of our domain name's that we own to this 3rd party comapany, so they can send emails to our customers and the from address is the domain name that we own, when someone replys to one of the emails exchange accepts the email and delivers it. ... What we want to know is if we use Exchange 2007 and setup an accepted domain for the domain that we use to email our customers, so instead of the email being sent from the 3rd party smtp server to its final destination, the email would be relayed through the exchange 2007 Example corporate emails that all the employess use is completly different that the one we delegate to the 3rd party company. ...
    (microsoft.public.exchange.connectivity)
  • Re: Problem resolution for obscure problem of not being able to send emails
    ... Linksys routers have a history of problems with mail, ... > The symptom is that all of a sudden you can no longer send emails. ... > all related to the smtp server closing the connetion. ... > firmware, you will have to downgrade it. ...
    (microsoft.public.outlook)
  • Re: Problem resolution for obscure problem of not being able to send emails
    ... Linksys routers have a history of problems with mail, ... > The symptom is that all of a sudden you can no longer send emails. ... > all related to the smtp server closing the connetion. ... > firmware, you will have to downgrade it. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)