Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub sendmails {
- if ($to eq '') {$to=$defaultemail;}
- eval{
- require Socket; import Socket;
- if ($smtpserv eq "") {$smtpserv = "127.0.0.1";}
- socket(SMTP, AF_INET, SOCK_STREAM, getprotobyname('tcp'));
- connect(SMTP, sockaddr_in(25, inet_aton("$smtpserv")));
- recv(SMTP, $datar, 2000, undef);
- send (SMTP, "helo $cookname\n", undef);
- recv (SMTP, $datar, 1000, undef);
- $datas[0]="mail from:$from\n";
- @tos=split /,\s*/, $to; foreach $tto (@tos) {push @datas, "rcpt to:$tto\n";}
- push @datas, "data\n";
- push @datas, "Subject: $subjectmail\nTo: $to\nFrom: $from\n${mailaddhead}MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n$letter\n.\n";
- foreach $datas (@datas) { send (SMTP, $datas, undef); recv (SMTP, $datar, 1000, undef);}
- close (SMTP); @datas = ();
- };
- $out=$@; goto END1; #err?
- }
Add Comment
Please, Sign In to add comment