I created a custom docker image for PHP that includes following:
- Custom PHP.ini file correct timezone configured
- Apache mod_rewrite enabled
- PHP PDO MySQL extension installed
You can access it here.
…and click here for Dockerfile link
Here’s a snippet of PHP code to help you send emails from Windows machine when a torrent has downloaded through uTorrent.
I am using Outlook.com to send and receive email but you can easily use GMail or any other internet mail service.
You will need PHPMailer class
$argOpts = “n:e:”;
$argVal = getopt($argOpts);
$torrent_name = $argVal[‘n’];
$to_email = $argVal[‘e’];
$mail = new PHPMailer();
$mail->Username = “Your outlook.com username”;
$mail->Password = “Your outlook.com password”;
$mail->Host = “smtp-mail.outlook.com”;
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->setFrom(“From address”, “From name”);
$mail->addReplyTo(“Reply To address”, “Reply To name”);
$mail->Subject = “Torrent done!”;
$mail->Body = “Finished downloading of \”” . $torrent_name . “\” on ” . date(‘M j, Y @h:i:s a’);
echo “Mailer Error: ” . $mail->ErrorInfo;
echo “Message has been sent”;
Save this to sendemailwhentorrentdone.php
You will need to wrap the php script call inside a .bat script for use with uTorrent.
php <path>\sendemailwhentorrentdone.php -n %1 -e to_email
Then in uTorrent, go to Options -> Preferences -> Advanced -> Run Program
Enter following in “Run this program when a torrent finishes”
uTorrent would automatically replace %N with title of torrent.
That’s all you need. From now onwards, your uTorrent client on Windows should be able to send email when a torrent is finished downloading.