From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gmail draft or delay message

Hello everyone,

 

I've looked through the forums and I've found alot of help with sending an email using my Gmail account.  Now, I want to be able to send an e-mail at a later date.  Specifically, I want to send one e-mail now and schedule a reminder a few weeks later.

 

In regards to Gmail, there is a script which allows you to schedule a delayed e-mail by saving a draft with a modified subject line, as described here: http://code.google.com/p/gmail-delay-send/wiki/GmailDelaySendSpecifyingDates

 

I'm wondering if Labview can allow me to either 1) schedule the time/date to send an e-mail or 2) save an e-mail as a draft INSTEAD of sending it immediately.  The second option would allow me to use the Gmail script.

 

Thanks.

0 Kudos
Message 1 of 14
(3,650 Views)

Hi pjr1121, I have seen no code to save a draft before, however you can start thinking on a case structure that may become true when an specific date and time are reached and then make the email structure enabled then sending the email at the time you programmed it.

 

Eric NI

0 Kudos
Message 2 of 14
(3,623 Views)

I had thought about doing something like that, but it would require either letting for loop run continuously so that the date can be checked or saving the e-mail info in a txt file.  This txt file would be checked each time the VI starts up, sending any e-mails which meet the date requirements.

 Both of these options are non ideal because they place too much requirement on if/when the program is excecuted.  Let's say I wanted to send an e-mail on the 15th,  but didn't run the program again until the 20th (FAIL)

 

The only solution I can think of along these lines, which is still non-ideal, is to have a separate VI which I set Windows to excecute every day.  The VI would load the txt file, check all messages set to be sent against the day's date.  Any messages that meet the requirements are sent, then removed from the file.  This would technically yield the results I want, but has some issues.  Storing the necessary info means also storing the gmail login (anyone else could open the txt file and get my login/password).  If the account password changes between the date I save the message and the send date, it won't work either. Another stopping point with this is that it also requires the computer to remain on at all times or be turned on daily (office computer so this probably won't happen) and is also something I can't garauntee that other end-users will do.

 

Overall, this method would probably work 90% of the time but I'll have to be diligent with protecting login info and allowing the program to run daily.  The Gmail draft option bypasses all of these concerns so it's the desired method.  I haven't seen a way to do this either so I may be asking for the impossible but am hopeful that someone smarter than I can figure it out.

0 Kudos
Message 3 of 14
(3,604 Views)

Hi pjr1121,

 

The option you described is not built in LabVIEW natively, however you can also take a look at this post that may help.

 

Eric NI

0 Kudos
Message 4 of 14
(3,584 Views)

Eric,

 

I am aware that this is not a native option in Labview, and the link you posted is where I started with all this.  I got alot of good advice from that thread.  I was just wondering if anyone had figured out a way to do this that isn't necessarily obvious.

 

 

0 Kudos
Message 5 of 14
(3,580 Views)

Late reply. What about sending a iCalendar attachment the contains a VTODO event?

 

http://en.wikipedia.org/wiki/ICalendar#To-do_.28VTODO.29

 

You could construct the file attachment in LabVIEW and send it immediately via GMAIL to one or more receipients. I think you should be able to automatically accept events from specified users if your schedule is open.


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 6 of 14
(3,564 Views)

It appears that GMAIL does not recognize an VTODO ICS attachment for adding into Google Calendar.

 

http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2132

 

I've tested sending a VEVENT attatchment to both Outlook and GMail with sucess...

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 7 of 14
(3,559 Views)

This sounds interesting, but doesn't it require the recipient to use a program which supports VEVENT?  For instance google calendar is supported, but many people don't use it.  Would it still have the desired result in this case?

0 Kudos
Message 8 of 14
(3,555 Views)

Most email packages have some sort of scheduling function. Outlook has a built-in calendar and gmail account users can create a calendar that may be optionally shared with others.

 

My test with gmail worked nice because it recognized the attatchment and presented me with the option to add the event to my calendar.

 

It sounds to me like you want schedule some sort of action (calibrate, clean or check operational status) after a condition in your code occurs.

 

The example you linked to strikes me as being more useful for press release related announcements such as "The New iPhone is available starting today!" (not true unless today is Sept 12)

 

If you send it when the event happens, you can add it to a calendar/schedule and plan in advance rather than returning from vacation and discovering that you haven't done something that leaves your process off-line.

 

 

 

 

VEVENT.PNG

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 9 of 14
(3,546 Views)

You make a very good point.  My idea was to send a reminder to individuals 2 weeks before certain documents need to be submitted so they can get everything in order.  Making it an event on a calendar serves the same purpose of reminding the individual before the deadline occurs.

 

I'll look into this further when I get some time and let you know how it works out.

0 Kudos
Message 10 of 14
(3,540 Views)