X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fmonkey%2Fmail_sender.c;h=82688260a50a6ebcd3a3a25fcaa37900979c8e38;hb=8533f3d1d476ea215f90da8059fd99c1dc6edf3e;hp=385198d06f745f6c980279483854cd8f29fb07b0;hpb=f9315d074e4fde63ee5df958ac2cea78423d9954;p=oweals%2Fgnunet.git diff --git a/src/monkey/mail_sender.c b/src/monkey/mail_sender.c index 385198d06..82688260a 100644 --- a/src/monkey/mail_sender.c +++ b/src/monkey/mail_sender.c @@ -145,18 +145,17 @@ print_recipient_status (smtp_recipient_t recipient, } -void sendMail() +void sendMail(const char *messageContents) { smtp_session_t session; smtp_message_t message; smtp_recipient_t recipient; - // auth_context_t authctx; const smtp_status_t *status; struct sigaction sa; char *host = "localhost:25"; char *from = "gnunet-monkey"; char *subject = "e-mail from Libesmtp!"; - const char *recipient_address = "halims@in.tum.de"; + const char *recipient_address = "safey.allah@gmail.com"; char tempFileName[1000]; int tempFd; FILE *fp; @@ -193,7 +192,7 @@ void sendMail() sprintf(tempFileName, "/tmp/messageXXXXXX"); tempFd = mkstemp(tempFileName); fp = fdopen(tempFd, "w"); - fprintf(fp, "Hello! This is a test message!\r\n"); + fprintf(fp, "%s", messageContents); fclose(fp); fp = fopen(tempFileName, "r"); smtp_set_message_fp(message, fp); @@ -222,14 +221,7 @@ void sendMail() /* Free resources consumed by the program. */ smtp_destroy_session(session); - // auth_destroy_context(authctx); fclose(fp); auth_client_exit(); - exit(0); } -int main() -{ - sendMail(); - return 0; -}