/ Forums / Advansys Formativ / Formativ Runtime / Sending email with different From addresses / Reply To: Sending email with different From addresses

#5777
Support 1a
Participant

Unfortunately no. GroupWise security stops you from ‘spoofing’ the from address. You can change the ‘FromText’ property, but this doesn’t change the ‘sent from’ email address. Here’s some sample code:

Sub Main(Client, GWEvent)
  
  dim iDlg
  dim iAddress
  dim iChkBoxCtl
  
  set iDlg = Utilities.NewControlBoxDialog  
  iDlg.Caption = IDS_CAPTION
  iDlg.Title = "Setup From Address"
  iDlg.Description = vbcrlf & "This applet will allow you to change the 'From' email address when sending a message."

  
  set iChkBoxCtl = iDlg.AddCheckListControl
  iChkBoxCtl.caption = "Select a from address:" 
  iChkBoxCtl.Options = fchClick
  
  
  ' ===============================================================================
  ' Add the from addresses in here.  
  call iChkBoxCtl.AddItem(GroupWise.account.owner.displayname, TRUE)
  call iChkBoxCtl.AddItem("Test 1", FALSE)
  call iChkBoxCtl.AddItem("Test 2", FALSE)
  call iChkBoxCtl.AddItem("Test 3", FALSE)
  ' ===============================================================================  
  
  
  ' Is the [Ok] button pressed?  
  if (iDlg.execute = btn1) then
    iAddress = replace(iChkBoxCtl.CheckedItems.CommaText, """", "")
    if (len(iAddress) > 0) then  
      call GroupWise.FocusSet(fcsFrom, "")
      GroupWise.TypeText(iAddress)
    end if    
  end if
  
    
  set iChkBoxCtl = nothing  
  set iDlg = nothing
  
End Sub

Advansys Support