Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
preferably using only bare c++ tools, without libraries?
system
. If, according to the conditions of the task, the use of external commands is permissible, then first man mail,
then working out sending the file through the command mail
, then calling it all through system()
or exec().
.
If you need to specify from whom - instead mail
use sendmail
.
If the use of external commands is unacceptable and you need / want to do it purely by means of the language (this is of course stupid, but informatively green) - we take RFC822, study the format of the e-mail message, then we take it and implement it.
That is, you will need to:
- form the correct headers of the letter
- form an attachment (mime-encoded, do not forget that onlydisplayed ASCII, no special characters!)
- connect to the server, transfer the initial information (who you are, from whom, to whom)
- do not forget about SPF / DKIM / DMARC (otherwise, with a high degree of probability, the letter will be in the trash, if at all it will be accepted - gmyl in this respect, simple as a log)
- to convey the formed letter
Wataru correctly said - a couple of months of hard work will go away, but how many skills you will immediately pull up: D
On the bash, by the way, one line is done (if without changing From :) and two or three - if with a change.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question