I am using the "SentOnBehalfOfName" in the below code, but the mail is getting sent from the default account and not the "sales@rfbcorp.com" that I specified. The weird thing is that it works correctly on one user in my company but not for 3 others with outlook. Is there another method to try? Any help is appreciated. Thanks
VBA Code:
Sub SEND_OUTLOOK_CONF_CLICK_FILENAME()
'Not using this macro. Decided to use the "send outlook conf" which automatically attaches the file.
Dim oLook As Object
Dim oMail As Object
Dim FD As Object
Dim vrtSelectedItem As Variant
Dim strbody As String
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.createitem(0)
Set FD = Application.FileDialog(3)
With oMail
.SentOnBehalfOfName = "sales@rfbcorp.com"
.To = Worksheets("DETAIL FORM").Range("F4")
.cc = ""
.HTMLBody = "See attached order confirmation. Your order will be released for production. Please notify us immediately if any changes are needed." & "<br/>" & "<br/>" _
& "Thank You" & "<br/>" & "<br/>" _
.Subject = "Friedland Confirmation" & " " & "PO " & Worksheets("DETAIL FORM").Range("B9").Value & ", S/M:" & " " & Worksheets("DETAIL FORM").Range("B8").Value
FD.AllowMultiSelect = True
FD.Filters.Clear
FD.Filters.Add "All Files", "*.*"
FD.InitialFileName = ActiveWorkbook.path & "\APDFQUOTES\"
'filePath = ActiveWorkbook.path & "\APDFQUOTES\" & Worksheets("DETAIL FORM").Range("F15").Value & ".pdf"
If FD.Show = True Then
For Each vrtSelectedItem In FD.SelectedItems
.Attachments.Add vrtSelectedItem
Next
End If
.Display
End With
Set FD = Nothing
Set oMail = Nothing
Set oLook = Nothing
End Sub