Adjust time in body of email based on time zone email is opened

288enzo

Well-known Member
Joined
Feb 8, 2009
Messages
721
Office Version
  1. 2016
Platform
  1. Windows
Currently I'm using the following in my email:

VBA Code:
    time_am = "<center>" & font_red & "===> Check your local time zone <===<br>" _
        & "10:00 AM -- Eastern Time<br>" _
        & "9:00 AM -- Central Time<br>" _
        & "7:00 AM -- Pacific Time</center></b>" & time_end

What would be outstanding is if I didn't need to break it down and only the start time would show based on the time zone the user opens the email.

Is this even possible?

Thank you,
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
What is your total code for building the email body?

There might be a way to do this with an HTML email body that includes JavaScript, but it won't work if your recipient has their email client configured to read all email as plain text, or does not allow JavaScript to run.

Rich (BB code):
var now = new Date();

That will create a new Date object with the client's local time, which can then be queried to show the local time.

I haven't done this so I can't provide a full-blown solution.
 
Upvote 0
What is your total code for building the email body?

There might be a way to do this with an HTML email body that includes JavaScript, but it won't work if your recipient has their email client configured to read all email as plain text, or does not allow JavaScript to run.

Rich (BB code):
var now = new Date();

That will create a new Date object with the client's local time, which can then be queried to show the local time.

I haven't done this so I can't provide a full-blown solution.
Thank you. I'll play around with it and see how it goes.
 
Upvote 0
What is your total code for building the email body?

There might be a way to do this with an HTML email body that includes JavaScript, but it won't work if your recipient has their email client configured to read all email as plain text, or does not allow JavaScript to run.

Rich (BB code):
var now = new Date();

That will create a new Date object with the client's local time, which can then be queried to show the local time.

I haven't done this so I can't provide a full-blown solution.
Not knowing how the recipient's client is configured is an issue. Any other way without Java?
 
Upvote 0
JavaScript, not Java. Two different things.

I don't know if any other way to do this, although I don't know everything there is to know. The email standard is not designed to have active content, so active content is treated based on the capabilities and configuration of the receiving client. There is no guarantee that a given client will support or permit JavaScript, or even HTML. Some people do not like to allow their clients to run active content because of the potential for malware to execute. I don't know of any other way to get active content into an email other than JavaScript in HTML.
 
Upvote 0

Forum statistics

Threads
1,215,239
Messages
6,123,816
Members
449,127
Latest member
Cyko

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top