Author Topic: Send an email in background and then delete it  (Read 1090 times)

0 Members and 1 Guest are viewing this topic.

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Send an email in background and then delete it
« on: November 20, 2019, 05:23:58 AM »
With this function (for example) it is possible to send an email in the background:
Code: [Select]
; 2015
;; Outlook Message  -  ronjonp (modified slightly by Lee Mac :-) )
;; rcp - [str] Email address (separate multiple with semi-colon)
;; sub - [str] Subject
;; bdy - [str] Body of email
;; att - [lst] List of filenames to attach
;; snd - [bol] T=Send email; nil=Open email to edit
;
(defun rjp-outlookmessage ( rcp sub bdy att snd / atm msg out rtn )
    (if (setq out (vlax-get-or-create-object "outlook.application"))
        (progn
            (setq rtn
                (vl-catch-all-apply
                   '(lambda nil
                        (setq msg (vlax-invoke-method out 'createitem 0)
                              atm (vlax-get msg 'attachments)
                        )
                        (vlax-put msg 'to rcp)
                        (vlax-put msg 'subject sub)
                        (foreach fnm att
                            (if (setq fnm (findfile fnm))
                                (vlax-invoke atm 'add fnm)
                            )
                        )
                        (if snd
                            (vlax-invoke msg 'send)
                            (vlax-invoke msg 'display :vlax-true)
                        )
                        t
                    )
                )
            )
            (foreach obj (list atm msg out)
                (if (= 'vla-object (type obj))
                    (vlax-release-object obj)
                )
            )
            (if (vl-catch-all-error-p rtn)
                (prompt (vl-catch-all-error-message rtn))
                rtn
            )
        )
    )
)
Questions:
Is it possible to send an email in background and then delete it after send?
Is it possible to use any application available on the PC?


MP

  • Seagull
  • Posts: 17488
Re: Send an email in background and then delete it
« Reply #1 on: November 20, 2019, 09:11:20 AM »
Is it possible to send an email in background?

Yes.

Is it possible to delete it after send?

Everything's possible but I believe trying to perform this task without direct access to the mail server would be challenging, acknowledging I'm no email expert. There may be a service that allows you to specify an email's deletion if not read within a specified time frame. That said, ummm why?
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #2 on: November 20, 2019, 09:17:04 AM »
... That said, ummm why?

Yes, I confess it's an unhealthy idea, I wanted to see which users use certain functions...

MP

  • Seagull
  • Posts: 17488
Re: Send an email in background and then delete it
« Reply #3 on: November 20, 2019, 09:23:39 AM »
You could gather, tally and send once a week. i.e. maybe selective (sending) frequency is the pragmatist’s solution.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #4 on: November 20, 2019, 09:27:37 AM »
Yes, that's what I thought, but the user sees my mail in the sent mail basket… :knuppel2:

MP

  • Seagull
  • Posts: 17488
Re: Send an email in background and then delete it
« Reply #5 on: November 20, 2019, 09:30:03 AM »
Not if you use the function I specified (in my use).

You could also just write to a network resident file the users have access to but wouldn't necessarily think to view - or be able to view - work with your sys admin.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #6 on: November 20, 2019, 09:34:51 AM »
can you be less mysterious? or it is a delicate matter (google transl.)…  :blink:

MP

  • Seagull
  • Posts: 17488
Re: Send an email in background and then delete it
« Reply #7 on: November 20, 2019, 09:50:24 AM »
wat
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #8 on: November 20, 2019, 09:58:35 AM »
WAT > What About Trash? 

if yes, you can take the risk, it's usually full of hundreds of emails and it's hard to see inside.

MP

  • Seagull
  • Posts: 17488
Re: Send an email in background and then delete it
« Reply #9 on: November 20, 2019, 10:03:33 AM »
Trashless in my experience. Did you try it or are you speculating?
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #10 on: November 20, 2019, 10:14:38 AM »
it's an idea that I had today (sorry but I'm not sure I understand correctly what you say about speculation and in general) :oops: :embarrassed2:

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9282
Re: Send an email in background and then delete it
« Reply #11 on: November 20, 2019, 10:15:46 AM »
MP, I don't believe post #5 was understood (-i.e. network file). And #8 was a guess/question as to what `WAT' means.

Marc'Antonio Alessi, If these people are on your network (or you have access to a server facing the internet) I would write to a network file instead of using email.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #12 on: November 20, 2019, 10:20:58 AM »
MP, I don't believe post #5 was understood (-i.e. network file). And #8 was a guess/question as to what `WAT' means.

Marc'Antonio Alessi, If these people are on your network (or you have access to a server facing the internet) I would write to a network file instead of using email.
Thanks… sorry now I see post #5    <<  YES >>.    (old age makes bad jokes)  :tickedoff:
Thanks again.

MP

  • Seagull
  • Posts: 17488
Re: Send an email in background and then delete it
« Reply #13 on: November 20, 2019, 10:33:00 AM »
Thanks for babel-fishing John. re: “wat” it was the capping response in a legendary, infamous 4chan exchange. Disturbing, hilarious & NSFW.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1019
  • Marco
Re: Send an email in background and then delete it
« Reply #14 on: November 20, 2019, 10:39:59 AM »
Trashless in my experience. Did you try it or are you speculating?
Apologizes for the misunderstanding.   :-)