janice
04-02-2004, 08:46 AM
Hello everyone,
Let me explain the issue first, then I will ask the question.
We have an email program that sends out weekly emails to top executives in our company letting them know if events unfold within the company.
The email works well as it is.
But recently, one of the executives wanted to cc his secretary so that in the event he is not around, his secretary will take care of whatever demands his attention.
The first thing we did as a temporary solution was to add a cc to the email code.
Problem that presented was that the secretary was getting copied on emails she didn't need.
The next option we tried was to concatenate the secretary's email address with that of the executive as one field on our database since the email addresses are getting pulled from our database.
There were problems with that also.
I have decided to create some if statement within the email address which says: if the email address being pulled from the db matches that of this particular executive's email, then copy his secretary, else don't copy her.
It isn't doing anything.
Can someone please take a look and help me figure out what I might be doing wrong.
Here is the code snip:
<%
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "gtc021"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
Flds.Update
With iMsg
Set .Configuration = iConf
.From = "admin@yahoo.com"
.To = ""&staffemail&""
.Sender = "admin@yahoo.com"
If &staffmail& = "johnDoe@home.com" then
.cc = "hisStaff@work.com"
end if
.Subject = "From Director's Office - Accident Occurrence"
.TextBody = "This is your incident report."
.Send
End With
'end of email code
'---------------------------------------------------------------------------------------------------------
'--------------------------------------------------------------------------------------------------------
Thanks in advance
Let me explain the issue first, then I will ask the question.
We have an email program that sends out weekly emails to top executives in our company letting them know if events unfold within the company.
The email works well as it is.
But recently, one of the executives wanted to cc his secretary so that in the event he is not around, his secretary will take care of whatever demands his attention.
The first thing we did as a temporary solution was to add a cc to the email code.
Problem that presented was that the secretary was getting copied on emails she didn't need.
The next option we tried was to concatenate the secretary's email address with that of the executive as one field on our database since the email addresses are getting pulled from our database.
There were problems with that also.
I have decided to create some if statement within the email address which says: if the email address being pulled from the db matches that of this particular executive's email, then copy his secretary, else don't copy her.
It isn't doing anything.
Can someone please take a look and help me figure out what I might be doing wrong.
Here is the code snip:
<%
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "gtc021"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
Flds.Update
With iMsg
Set .Configuration = iConf
.From = "admin@yahoo.com"
.To = ""&staffemail&""
.Sender = "admin@yahoo.com"
If &staffmail& = "johnDoe@home.com" then
.cc = "hisStaff@work.com"
end if
.Subject = "From Director's Office - Accident Occurrence"
.TextBody = "This is your incident report."
.Send
End With
'end of email code
'---------------------------------------------------------------------------------------------------------
'--------------------------------------------------------------------------------------------------------
Thanks in advance