[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Howto, mail



Meyland Peter wrote:
> Hvordan pokker sender jeg en email inde fra et lille C program?

Hvis performance problemer gør at du ikke vil popen et program,
så kan du åbne en socket til port 25, og så sende emailet direkte
til sendmail deamonen, forudsat at du kører en mail service der
er konfigureret til at modtage og sende post videre ud af huset.

prøv:

telnet localhost 25
helo DITSERVERNAVN
mail from:<afsender email>
rcpt to:<modtager email>
data
Subject: SUBJECT

body af email
.
quit

Bemærk punktum på tom line afslutter et email, og "data"
betyder at email body starter. Tester du det på en server
uden net forbindelse så kør sendmail -q for at flushe køen,
eller er det sendmail -bs ???.

Når du afsender det sidste punktum vil sendmail returnere
en "email accepted" kode, og afsende emailet, men du kan
sende mange emails ved efter "." at komme med en ny
mail from:.... indtil alle emails er afsendt.

Du kan sende præcist den samme tekst igennem en socket
fra et C program, og få sendmail til at sende posten videre
uden særligt meget overhead. Det bliver dog mere besværligt
end popen fordi man skal checke hvad sendmail returnere af
koder.

-- 
* Kurosawa: http://www.designlabs.dk/husetsbio *
* Email: Carsten dot Svaneborg at risoe dot dk * 
*  http://www.fys.risoe.dk/fys/External/casv/  *




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *