The send mail-element does not allow to define the sender of the mail, this adress is defined in the switch preferences. We have the requirement to send from various email-adresses. Is a script or a similar solution available for this?
Kind regards,
Jörg
Send Mail: Define sender
Send Mail: Define sender
That is what you define in the property "Reply address". If that is empty, the address in the Preferences is being used.
Freddy
Freddy
-
- Member
- Posts: 30
- Joined: Mon Mar 21, 2011 2:30 pm
Send Mail: Define sender
Hi Freddy,
I'm aware of this and i already use it.
The main reason for the demand are out-of-office-mails: We send out > 100 mails per day and in the holiday season we get many out-of-office notifications. The most are replied to the sender and not to the reply-to adress.
Kind regards,
Jörg
I'm aware of this and i already use it.
The main reason for the demand are out-of-office-mails: We send out > 100 mails per day and in the holiday season we get many out-of-office notifications. The most are replied to the sender and not to the reply-to adress.
Kind regards,
Jörg
Send Mail: Define sender
I logged it as a feature request.
Freddy
Freddy
-
- Member
- Posts: 30
- Joined: Mon Mar 21, 2011 2:30 pm
Send Mail: Define sender
I wrote a FR last tuesday, too.
Re: Send Mail: Define sender
Anything new on this? We have the same requirement. Is it possible right now?
And we also need to change the name of the sender based on the processed job.
Thanks!
Tim
And we also need to change the name of the sender based on the processed job.
Thanks!
Tim
Re: Send Mail: Define sender
They probably do not want to put this feature in Switch due to probable spam use.
For this particular reason, I am using little windows free app called Blat, http://www.blat.net/
For this particular reason, I am using little windows free app called Blat, http://www.blat.net/
Re: Send Mail: Define sender
I got around this by creating a VBScript in SwitchScripter which runs whenever a job arrives at the script.
Here is the example code to make the script. You can add your own From, To, Cc, and Bcc addresses.
It's not ideal but it does the job of being able to fake the sender's email address from Switch flows. I agree that it would be nice to be able to define the sender address on a flow by flow level.
Subject: Write your subject here, it is followed by the current date 22.08.2018
From: from_address@yourcompany.com
To: to_address@theircompany.com
Cc: cc_address@anothercompany.com
Bcc: bcc_address1@yourcompany.com; bcc_address2@yourcompany.com
Message attachment: EmailAttachment.zip
Hello World
You can type your message body text here
Kind Regards
on behalf of the Switch Server
Here is the example code to make the script. You can add your own From, To, Cc, and Bcc addresses.
It's not ideal but it does the job of being able to fake the sender's email address from Switch flows. I agree that it would be nice to be able to define the sender address on a flow by flow level.
Code: Select all
' Is invoked each time a new job arrives in one of the input folders for the flow element.
' The newly arrived job is passed as the second parameter.
Function jobArrived(s, job)
Set objMessage = CreateObject("CDO.Message")
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
'date
d = Day(date())
m = Month(date())
y = Year(date())
If len(d) = 1 Then d = "0" & d
If len(m) = 1 Then m = "0" & m
dateSubject = d & "." & m & "." & y
dateNormal = d & "-" & m & "-" & y
dateReverse = y & "_" & m & "_" & d
'email
objMessage.Subject = "Write your subject here, it is followed by the current date " & dateSubject
objMessage.From = "from_address@yourcompany.com"
objMessage.To = "to_address@theircompany.com"
objMessage.Cc = "cc_address@anothercompany.com"
objMessage.Bcc = "bcc_address1@yourcompany.com; bcc_address2@yourcompany.com"
emailBody = "Hello World" & vbCrLf & vbCrLf _
& "You can type your message body text here" & vbCrLf & vbCrLf _
& "Kind Regards" & vbCrLf & vbCrLf _
& "on behalf of the Switch Server" & vbCrLf & vbCrLf
objMessage.TextBody = emailBody
objMessage.AddAttachment "\\yourServer\Path\Folder\AnotherFolder\EmailAttachment.zip"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTPConnectString"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 15
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = nothing
'Send job to next flow element
job.sendToSingle(job.getPath())
End Function
Subject: Write your subject here, it is followed by the current date 22.08.2018
From: from_address@yourcompany.com
To: to_address@theircompany.com
Cc: cc_address@anothercompany.com
Bcc: bcc_address1@yourcompany.com; bcc_address2@yourcompany.com
Message attachment: EmailAttachment.zip
Hello World
You can type your message body text here
Kind Regards
on behalf of the Switch Server
- JimmyHartington
- Advanced member
- Posts: 310
- Joined: Tue Mar 22, 2011 7:38 am
Re: Send Mail: Define sender
I use the webservice https://postmarkapp.com for sending emails as some of my customers.
You need to setup DNS records for this to work.
And of course script to communication with the api.
I have bought a script package through my reseller (InProduction), which does this for me.
You need to setup DNS records for this to work.
And of course script to communication with the api.
I have bought a script package through my reseller (InProduction), which does this for me.
Re: Send Mail: Define sender
Check out SES Send if you like AWS https://github.com/open-automation/switch-aws#ses-send
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.