Command line to send an automated mail? #1669
Unanswered
europacafe
asked this question in
Q&A
Replies: 1 comment 1 reply
-
SnappyMail can't. #!/usr/bin/php
<?php
$_ENV['SNAPPYMAIL_INCLUDE_AS_API'] = true;
require '/path/to/snappymail/index.php';
$SmtpSettings = \MailSo\Smtp\Settings::fromArray([
'host' => 'localhost',
'port' => 143,
'type' => \MailSo\Net\Enumerations\ConnectionSecurityType::NONE,
'ssl' => []
]);
/*
$SmtpSettings->Login = 'myusername';
$SmtpSettings->Password = 'mypassphrase';
$SmtpSettings->useAuth = true;
*/
$oSmtpClient = new \MailSo\Smtp\SmtpClient;
$oSmtpClient->SetLogger(\RainLoop\API::Logger());
$oSmtpClient->Connect($SmtpSettings);
// $oSmtpClient->Login($SmtpSettings);
$oSmtpClient->MailFrom('me@domain.tld');
$oSmtpClient->Rcpt('me@gmail.com');
$oSmtpClient->Data('contents of message.eml'); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I run snappymail as a container (+stalwart mail server) and I love it. I use a SMTP relay service provider for all outgoing mails to ensure my mail is not put in their spam mailboxes.
I would like to automatically send a mail to those mailboxes (yahoo, gmail, outlook) weekly so that the SMTP relay service sees I'm still an active account.
If possible, I want to use a command line to send such mail and use cron to schedule the sending. Could you give a few examples of command line?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions