'========================
'Private Sub AddReplyRecip(objMsg As MailItem, strName As String)
' Dim colReplyRecips As Recipients
' Dim objReplyRecip As Recipient
' Dim strPrompt As String
' Dim intRes As Integer
' Dim strRecipName As String
'
' Set colReplyRecips = objMsg.ReplyRecipients
' Set objReplyRecip = colReplyRecips.Add(strName)
' objReplyRecip.Resolve
' If Not objReplyRecip.Resolved Then
' objReplyRecip.Delete
' strPrompt = strName & " could not be resolved as " & _
' "a valid Outlook address. Do you want to try " & _
' "a different name?"
intRes = MsgBox(strPrompt, _
' vbYesNo + vbQuestion + vbDefaultButton1, _
' "Try Again?"
' If intRes = vbYes Then
' strRecipName = GetReplyAddress()
' If strRecipName <> "" Then
' Call AddReplyRecip(objMsg, strRecipName)
' End If
' End If
' End If
' Set colReplyRecips = Nothing
' Set objReplyRecip = Nothing
'End Sub
'========================
Sandy
What property exposes the delegate option so you could turn it on or off if you wanted to send an email with a generic from (eg info@blahblahblah.com)?
From what I understand, you can't send an email in this manner. You need permission to send an email from the address supplied. For example, I have permission for the inbox/account of it@company.com although my personal email account is si@company.com. That's how my code manages to work in this case.
If you want to send email from another address you may want to use CDONTS (if possible). I prefer this anyway, but you need to have IIS installed on the PC and may need a smart host setting up.
If I understand you correctly, modifying the "from" field can indeed be a security issue with your System Administrators.
So, the Option adjustment I provided above revises the "Have replies sent to:" field, to ensure the respondents, when they hit the "Reply to:" button have the appropriate address placed therein.
Thanks Sandy, the code that you have written is helpful in understanding the email object a bit more. However, we needed the same address to be seen in the user's inbox and the SendOnBehalfOfName property works perfectly for this irrespective of who uses the application. The ReplyRecipients still uses the user's email address.
I know that the only people that are going to use the application will have access to this email account.
The security issues you mentioned may very well be a problem for other people but it is ok in our case.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.