| || |
From email address in workflow code
Hi We are generating emails via the workflow code using the standard HP code (copied below). The issue is when we use this it uses the email address of the person raising the defect instead of a generic email address such as firstname.lastname@example.org. Is there a way to include the from email address.
We have added FROM_EMAIL_ADDRESS to the dataconst table and as a parameter in site configuration but it doesn't appear to use it.
It uses the FROM_EMAIL_ADDRESS from the dataconst table when we use the Automail functionality but we are finding this is unreliable and just stops at least once a day until we manually send an email. We want to be able to generate the email through code when the assigned to value changes but would like the emails to come from a generic address
Sub SendDefect (iObjectId, strTo, strCc, strSubject, strComment)
On Error Resume Next
Dim objBugFactory, objBug
Set objBugFactory = TDConnection.BugFactory
Set objBug = objBugFactory.Item(iObjectId)
objBug.Mail strTo, strCc, 2, strSubject, strComment
Set objBug = Nothing
Set objBugFactory = Nothing
On Error GoTo 0
Re: From email address in workflow code
The SendMail method accepts a From address, although the docs say this is now deprecated. You could try it and see if it still works (I used to use it a previous job), although you'd need to compile the Bugs history yourself to send in the email.
<font color="#6B6B6B">Scott Genevish
Principal Consultant Designed Quality