simple program to send an email

David Fletcher dave at thefletchers.net
Mon Jun 17 11:43:56 UTC 2019


On Mon, 2019-06-17 at 12:01 +0100, Peter Flynn wrote:
> On Mon, 17 June 2019 at 06:01, Bob <ubuntu-qygzanxc at listemail.net>
> wrote
> 
> > 
> > So far the only program I have tried is "senEmail" which I am
> > having 
> > a problem with it connecting to my hosted email server because of
> > security problems.
> I don't know senEmail...is that meant to be sendmail?

NO NO NO as I stated above it is sendEmail.

Just to make absolutely clear how to use sendEmail, here is the snippet
of my C++ code that sets up and calls sendEmail:-

{
 strcpy(SendEmailBuf, "sendEmail -q -f ");
 strdncat(SendEmailBuf, Settings.ReturnEmailFrom(), SENDEMAIL_BUF_LEN);
 strdncat(SendEmailBuf, (char *)" -t ", SENDEMAIL_BUF_LEN);
 strdncat(SendEmailBuf, Settings.ReturnEmailTo(), SENDEMAIL_BUF_LEN);
 strdncat(SendEmailBuf, (char *)" -u \"", SENDEMAIL_BUF_LEN);
 strdncat(SendEmailBuf, Dates.ReturnReminderTextPointer(),
SENDEMAIL_BUF_LEN);
 strdncat(SendEmailBuf, (char *)"\"", SENDEMAIL_BUF_LEN);

 strdncat(SendEmailBuf, (char *)" -m Repeating reminder",
SENDEMAIL_BUF_LEN);

 system(SendEmailBuf);
}

Further, I have a section in my Ubuntu server 14.04 setup notes that
suggests:-
Compile the reminder program.
Move DFReminder to /usr/local/bin/
Restore the entries to crontab
Might need to alter
/etc/hosts
from
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
to
::1     ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
in order to keep dfreminder working

which I think was a suggestion by Karl after I asked a question on
ubuntu-users.

I also seem to remember having to add localhost to the mynetworks line
in the postfix/main.cf to get postfix to accept reminder emails, from
the program which runs on the same server kicked off every night by
crontab.

That, I think, is just about all that I can say on the subject.

Bye for now.

Dave




More information about the ubuntu-users mailing list