simple program to send an email

Mike Marchywka marchywka at hotmail.com
Mon Jun 17 12:21:12 UTC 2019


On Mon, Jun 17, 2019 at 12:43:56PM +0100, David Fletcher wrote:
> 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);
> }

Did you try it from the command line ( fwiw, I just wrote a class to do string concats
that keeps track of the end so you can get better control over memory (re-)usage and know
where the string(s) end ... )? 
It probably has a verbose mode to echo server responses and that should be helpful. 
There are always little quirks etc.  Are there quotes in your message? 
I also just wrote a system call wrapper to get the output and you may want
to see what it is actually doing. There is probably a library with all this stuff,
not sure about boost. I'm using libetpan for IMAP and the downloader seems to work
although I did not check the nice things like killing connections etc.  




> 
> 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
> 
> -- 
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

-- 

mike marchywka
306 charles cox
canton GA 30115
USA, Earth 
marchywka at hotmail.com
404-788-1216
ORCID: 0000-0001-9237-455X




More information about the ubuntu-users mailing list