Let’s talk about how a customer of EmailToVoice.Net forwards an email from an application or monitoring software as a voice phone call.

The Situation that Needs to be Solved

If the Monitoring Service sends the email from an email address that has the same domain as your company, or from an email that you have exclusive rights, then no problem. You can specify that email address in the Subscription form as a ‘Send Only’ Email address or contact us to add the Send-Only email address to your account. Then begin making phone calls from your application or monitoring service. In your application, you merely change the email recipient to something like 5551231234@tts.message-service.org. (Where 5551231234 is any phone number in the world. This number does not need to be preregistered.)

It is important to note that Emailtovoice.net requires that the Email message sent to EmailToVoice.Net be from your company email address. That means that the email address has the same domain as your company URL or your company has exclusive rights to the email address.

However, sometimes the application originating the message will send from its general-purpose email address. For instance, monitoring software will send an alert email from an email address within their own service domain. This is a problem because the email address must be unique to the EmailToVoice.Net customer so that usage can be applied approriately.

The X-Header Alternative

Now, there is a sophisticated alternative to solve the issue caused by an application or monitoring service sending the Email FROM a general-purpose email address, which is not exclusively owned by the Emailtovoice.net customer.

That alternative is to have a special code be entered into the x-Header of the email sent to EmailToVoice.Net. That code is then entered into the customer’s EmailToVoice.Net account profile. So, any message coming into EmailToVoice.Net with that unique code in the x-header will be assigned to the appropriate EmailToVoice.Net customer account.
The X-Header ID method of account identification disregards the FROM email address when the email arrives in EmailToVoice.Net.

X-Header Parameters

Using Microsoft Mail flow rule actions in Exchange Online, you can add a Header Name and a Header Value. For more info on this Mail flow rule actions in the Exchange Online feature:

https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rule-actions

Some common parameters are:

X-Header-ID

“X-Header-ID” is an alternate method of user identification. If a field called “X-Header-ID” is
found in the header of an email arriving at EmailToVoice.Net, the system searches for a user with a
matching “X-Header-ID” value setup in their user profile using that account to send the
message.

When this field is found, the sender’s email address is not used to identify the user account. Therefore, the FROM email address does not have to match the Customer’s URL or even be owned by the EmailToVoice.Net customer..

Note, for backward compatibility, equivalent email header fields are “X-EtoBcode”.

Additional account selection options

If you can not edit the email headers, and you are stuck with a fixed sender address, you can
also identify your account by adding “<EtoBcode>*my xheader id*</EtoBcode> to the start of
your email body.

The important issue is the FROM email address is from the customer’s domain, not the Monitoring Service domain. Or, if it is not possible to send the email to our service FROM an email address owned by your company, or, alter the X-Header of the email coming into our service, then the FROM email address must be owned exclusively by the customer.

The Gmail Alternative

If you need to use GMAIL, then to achieve the desired behavior where the forwarded email appears to come from `youremail@yourcompanydomain.com` and is addressed to `5551231234@tts.message-service.org’ or ‘list-alerts@tts.message-service.org’, you will need to Forward the email from an intermediate email address that is owned by your company. That email address will be the FROM email address as it enters our service.

Since Gmail’s standard forwarding feature retains the original sender’s address, you will need to use Google Apps Script.
(Outlook is simpler because Outlook retains the forwarding email address as the FROM email address. GMAIL does not. Gmail retains the Sending email address as the FROM email address)

Here’s a step-by-step guide to setting up an automatic forwarding system using Google Apps Script:

In this example, we use the List function rather than sending the message to 5551231234@tts.message-service.org. The reason we do this is because it would be easier for the customer to change the recipient phone number(s) in the Customer Portal / Personal Lists rather than changing the Google Apps Script.

### Using Google Apps Script for Custom Email Forwarding

1. **Access Google Apps Script:**
– Open your web browser and log in to your Gmail account. This Gmail account is the intermediate email address that is used for forwarding messages to our service.
We prefer if this email address has your company domain. However, you can use a free Gmail email address here as long as you attest that your company has exclusive rights to log in and access this email address.

This intermediate email address will be the Send-Only email address specified by us in your EmailToVoice.Net customer account. You either specify this email address in the Subscription Form or use the Contact Us form and request we add this email address to your customer account profile.

(`intermediateforwardemail@yourcompanydomain.com`).
– Go to [Google Apps Script](https://script.google.com/).

2. **Create a New Project:**
– Click on the `New project` button.

3. **Write the Script:**
– Delete any code in the script editor and replace it with the following script:

“`javascript
++++++++++

 

function forwardEmails() {
var label = GmailApp.getUserLabelByName('ForwardThis');
if (!label) {
label = GmailApp.createLabel('ForwardThis');
}
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
var messages = thread.getMessages();
for (var j = 0; j < messages.length; j++) {
var message = messages[j];
var from = message.getFrom();
if (from.indexOf(‘generalemailaddress@monitoringsoftware.com') !== -1) {
var body = message.getBody()
var subject = message.getSubject();
var recipient = ‘list-alerts@tts.message-service.org';
GmailApp.sendEmail(recipient, subject, '', {htmlBody: body, from: ‘intermediateforwardemail@yourcompanydomain.com’ });
message.moveToTrash(); // Optional: Move the original email to trash after forwarding
}
}
thread.removeLabel(label);
}
}

++++++++
“`

4. **Save the Script:**
– Click on `File` > `Save`, and give your project a name (e.g., `AutoForwardEmails`).

5. **Authorize the Script:**
– Click on the `Run` button (triangle icon) and authorize the script by following the prompts to grant the necessary permissions.

6. **Set Up a Trigger:**
– Click on the clock icon in the toolbar (Triggers).
– Click on `+ Add Trigger`.
– Set the function to `forwardEmails`, deploy to `Head`, and select a time-driven trigger (e.g., `Every 5 minutes` or `Hourly`).
– Save the trigger.

7. **Label Incoming Emails:**
– Go back to your Gmail inbox (`intermediateforwardemail@yourcompanydomain.com `).
– Create a filter to automatically label incoming emails from `denis.oneil@olinkscorp.com`.
– Click on the search bar, then click on the `Show search options` icon.
– Enter ` generalemailaddress@monitoringsoftware.com’` in the `From` field.
– Click `Create filter`.
– Check the box `Apply the label` and choose `ForwardThis` (or create a new label if it doesn’t exist).
– Click `Create filter`.

### Explanation:

– **Google Apps Script**: The script checks for emails with the label `ForwardThis`, and if the email is from `generalemailaddress@monitoringsoftware.com’, it forwards it to `list-alerts@tts.message-service.org` with the `FROM` address set to `intermediateforwardemail@yourcompanydomain.com`.
– **Triggers**: The script runs periodically (based on the trigger settings) to check for new emails to forward.

This setup should ensure that the forwarded emails appear as if they are sent from `intermediateforwardemail@yourcompanydomain.com` to `list-alerts@tts.message-service.org`.

Remember that `intermediateforwardemail@yourcompanydomain.com` must be set as the Send-Only email address in the EmailToVoice.Net customer account profile.

Updating the Gmail Alternative

If you need to change the Google Apps Script after it has been deployed in a production environment, you can follow these steps. We are not saying this is the only way or even the best way to change existing script code, but it is an alternative for changing the script code.

You can create a new project with a unique name and copy your script code into the new project. Then rename remove the old project.
Create a New Project:

o Go to Google Apps Script.
o Click on the New project button.

 

2. Copy the Script Code:

o In the new project, copy your existing script code from the old project.

3. Paste and Save the Code:

o Paste the copied code into the new project’s script editor.
o Click on File > Save and give your project a new name.

4. Set Up Triggers Again:

o Recreate any necessary triggers for the new project by following the steps to add triggers.

By following these steps, you should be able to edit and save your Google Apps Script successfully.
There may be a more dynamic method than deleting and renaming a project. Please investigate for yourself.

Outlook Email Alternative

Another solution to using Gmail is using an Outlook account. Again, Gmail does not retain the name of the forwarding email address as the FROM email address after the forwarding. Outlook does retain the email address of the forwarding email as the FROM email address.

Here’s a possible way you can set it up.

Setting Up Automatic Forwarding in Outlook

1. Log in to Your Outlook Account:

Access your Outlook account, such as ‘intermediateforwardemail@yourcompanydomain.com’

Set Up Email Forwarding:

Click on the gear icon (Settings) in the upper right corner.

Select “View all Outlook settings” at the bottom.

Navigate to “Mail” > “Forwarding”.

Check the box for “Enable forwarding”.

Enter the email address ‘list-alerts@tts.message-service.org’

Optionally, check the box for “Keep a copy of forwarded messages” if you want to retain a copy in the original mailbox.

Click “Save”

Create a Rule for Specific Sender:

Go to “Mail” > “Rules”.

Click on “Add new rule”.

Give your rule a name (e.g., “Forward alert Emails to Phones”).

Under “Add a condition”, select “From” and enter ‘generalemailaddress@monitoringsoftware.com’

Under “Add an action”, select “Forward to” and enter ‘list-alerts@tts.message-service.org’

Click “Save”

Advantages of Using Outlook

By using Outlook, you can achieve the desired email forwarding behavior more effectively than with Gmail’s standard forwarding features. When emails are forwarded from an Outlook account, the FROM address will be the Outlook account, not the original sender’s address.

Conclusion

In all cases, please do your investigation of these alternatives. We at EmailToVoice.Net are not experts in email forwarding and new features from different providers can be added at any time. We specialize in converting email content into a nice-sounding voice in many dialects or into an SMS or rich text secure message via SMS.

Test all changes before going into production. And then consider setting limits so that if there is a problem with your code, the impact is limited.

Please contact us to learn more about how we can assist you in your mission-critical business communications needs.