techexpressinc
Registered User.
- Local time
- Today, 04:09
- Joined
- Nov 26, 2008
- Messages
- 185
I am using a common function xmail and the cc part is not working does anyone know what i can do to fix it?
I get the to part of the email to work but the cc will not work. It is listed as the cc on the to mail, but the email for the cc is not generated.
Thx Russ below is code:
I get the to part of the email to work but the cc will not work. It is listed as the cc on the to mail, but the email for the cc is not generated.
Thx Russ below is code:
Code:
Option Compare Database
Public Function Xmail(strTo As String, strFrom As String, strSub As String, strBody As String, Optional strAtt As String)
'[This function will let you send email messages via SMTP without involving your local email client, like Outlook.]
'[As such, there is no "sent" history, so this option would not be preferred if you need to have this history.]
'[Requires reference to Microsoft CDO 1.21 Library, though it sometimes works without.]
'[As coded, this only works for unsecured/internal SMTP servers. However, you can add in login information should you need to.]
'[strAtt is the only optional argument and, if included, must be the full path and extension. Ex: "c:\file.txt"
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = strSub
objMessage.From = strFrom
objMessage.to = strTo
objMessage.TextBody = strBody
objMessage.CC = "[EMAIL="Russell.Neuman@xyz.com"]Russell.Neuman@xyz.com[/EMAIL]"
If Len(strAtt) > 0 Then
objMessage.AddAttachment strAtt
End If
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("[URL]http://schemas.microsoft.com/cdo/configuration/sendusing[/URL]") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("[URL]http://schemas.microsoft.com/cdo/configuration/smtpserver[/URL]") = "inxyz.us.ad.xyz.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("[URL]http://schemas.microsoft.com/cdo/configuration/smtpserverport[/URL]") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.CC = "[EMAIL="Russell.Neuman@xyz.com"]Russell.Neuman@xyz.com[/EMAIL]"
objMessage.Send
End Function
Last edited: