email help

D

dok112

Hey y'all, I have the below code I'm using to generate an email to
someone whenever we receive negative feedback from our clients. Is
there a way to "mask" the from address to say something else instead of
the person that is sending it, or a way to not make it appear at all?
I'm looking for something kind of like the bcc command but for the
from. Is this possible? Any one have any ideas?

TIA!

Code:
Sub EmailMGR()

Dim iname As Variant
Dim ClaimNumber As Variant
Dim ShopID As Variant
Dim comments As Variant
Dim attach1 As Variant
Dim subj As Variant
Dim StAg As Variant
Dim SoAg As Variant
Dim SoDi As Variant
Dim StDi As Variant
Dim NoAp As Variant

[iname] = ThisWorkbook.Sheets("Raw_Data").Range("A2").Value
[ClaimNumber] = ThisWorkbook.Sheets("Raw_Data").Range("D2").Value
[ShopID] = ThisWorkbook.Sheets("Raw_Data").Range("B2").Value
[comments] = ThisWorkbook.Sheets("Raw_Data").Range("M8").Value
[attach1] = ThisWorkbook.Sheets("Raw_Data").Range("D11").Value
[subj] = "Negative Survey recorded on "
[StAg] = ThisWorkbook.Sheets("Raw_Data").Range("E12").Value
[SoAg] = ThisWorkbook.Sheets("Raw_Data").Range("E13").Value
[SoDi] = ThisWorkbook.Sheets("Raw_Data").Range("E14").Value
[StDi] = ThisWorkbook.Sheets("Raw_Data").Range("E15").Value
[NoAp] = ThisWorkbook.Sheets("Raw_Data").Range("E16").Value

Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
'.To = "test1"
..bcc = "test2"
..Subject = "" & [subj] & "" & [ShopID] & ""
..body = "The below survey has been recorded and flagged for review:" &
Chr(10) & "" & Chr(10) & "Name: " & [iname] & "" & Chr(10) & "Claim: "
& [ClaimNumber] & "" & Chr(10) & "Shop: " & [ShopID] & "" & Chr(10) &
"Comments: " & [comments] & "" & Chr(10) & "" & Chr(10) & "Total
responses received for each answer catagory:" & Chr(10) & "Strongly
Agree: " & [StAg] & "" & Chr(10) & "Somewhat Agree: " & [SoAg] & "" &
Chr(10) & "Somewhat Disagree: " & [SoDi] & "" & Chr(10) & "Strongly
Disagree: " & [StDi] & "" & Chr(10) & "Not Applicable: " & [NoAp] & ""
& Chr(10) & "" & Chr(10) & "A copy of the survey has been attached for
your review." & Chr(10) & "" & Chr(10) & ""
..Attachments.Add "" & [attach1] & ""
..Send
End With

Set OutMail = Nothing
Set OutApp = Nothing
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 
R

Ron de Bruin

Hi dok112

You can use CDO
http://www.rondebruin.nl/cdo.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


dok112 said:
Hey y'all, I have the below code I'm using to generate an email to
someone whenever we receive negative feedback from our clients. Is
there a way to "mask" the from address to say something else instead of
the person that is sending it, or a way to not make it appear at all?
I'm looking for something kind of like the bcc command but for the
from. Is this possible? Any one have any ideas?

TIA!

Code:
Sub EmailMGR()

Dim iname As Variant
Dim ClaimNumber As Variant
Dim ShopID As Variant
Dim comments As Variant
Dim attach1 As Variant
Dim subj As Variant
Dim StAg As Variant
Dim SoAg As Variant
Dim SoDi As Variant
Dim StDi As Variant
Dim NoAp As Variant

[iname] = ThisWorkbook.Sheets("Raw_Data").Range("A2").Value
[ClaimNumber] = ThisWorkbook.Sheets("Raw_Data").Range("D2").Value
[ShopID] = ThisWorkbook.Sheets("Raw_Data").Range("B2").Value
[comments] = ThisWorkbook.Sheets("Raw_Data").Range("M8").Value
[attach1] = ThisWorkbook.Sheets("Raw_Data").Range("D11").Value
[subj] = "Negative Survey recorded on "
[StAg] = ThisWorkbook.Sheets("Raw_Data").Range("E12").Value
[SoAg] = ThisWorkbook.Sheets("Raw_Data").Range("E13").Value
[SoDi] = ThisWorkbook.Sheets("Raw_Data").Range("E14").Value
[StDi] = ThisWorkbook.Sheets("Raw_Data").Range("E15").Value
[NoAp] = ThisWorkbook.Sheets("Raw_Data").Range("E16").Value

Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
'.To = "test1"
bcc = "test2"
Subject = "" & [subj] & "" & [ShopID] & ""
body = "The below survey has been recorded and flagged for review:" &
Chr(10) & "" & Chr(10) & "Name: " & [iname] & "" & Chr(10) & "Claim: "
& [ClaimNumber] & "" & Chr(10) & "Shop: " & [ShopID] & "" & Chr(10) &
"Comments: " & [comments] & "" & Chr(10) & "" & Chr(10) & "Total
responses received for each answer catagory:" & Chr(10) & "Strongly
Agree: " & [StAg] & "" & Chr(10) & "Somewhat Agree: " & [SoAg] & "" &
Chr(10) & "Somewhat Disagree: " & [SoDi] & "" & Chr(10) & "Strongly
Disagree: " & [StDi] & "" & Chr(10) & "Not Applicable: " & [NoAp] & ""
& Chr(10) & "" & Chr(10) & "A copy of the survey has been attached for
your review." & Chr(10) & "" & Chr(10) & ""
Attachments.Add "" & [attach1] & ""
Send
End With

Set OutMail = Nothing
Set OutApp = Nothing
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top