Hello all!
I have a function that emails an update status to a client, I was successfully able to get the company name and address into HTML format, however, I cannot get the employees' email address into HTML format at the end of the email. I keep getting a syntax error. I am trying to pull the employee's email from the form (which works fine in the top section)
TIA!Code:If IsNull(Me.UserEmail) Then MsgBox "Please enter your email address" Me.UserEmail.SetFocus Exit Sub End If On Error GoTo errHandler Const cdoSendUsingPickup = 1 Const cdoSendUsingPort = 2 Const cdoAnonymous = 0 Const cdoBasic = 1 Const cdoNTLM = 2 Set omail = CreateObject("CDO.Message") omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2 omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "smtp.gmail.com" omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...tpauthenticate") = cdoBasic omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...n/sendusername") = Me.UserEmail omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...n/sendpassword") = Me.password omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = 465 omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...ion/smtpusessl") = True omail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 60 omail.From = Me.UserEmail omail.To = Me.invoiceemail omail.BCC = "" omail.Subject = Me.EmailSubject omail.HTMLBody = "<font size='2' face='Verdana, Arial, Helvetica, sans-serif'>" omail.HTMLBody = Forms!mainprocessentry!COMMENTS omail.HTMLBody = omail.HTMLBody & "<font face=""Comic Sans MS"" size=""3"" color=""blue""><b>CompanyName</b></font><BR>" omail.HTMLBody = omail.HTMLBody & "<font face=""Times New Roman"" size=""2"" color=""blue""><i>Address</font><BR>" omail.HTMLBody = omail.HTMLBody & "<font face=""Times New Roman"" size=""2"" color=""blue""><i>Ellisville, MS 39437</font><BR>" omail.HTMLBody = omail.HTMLBody & "<font face=""Times New Roman"" size=""2"" color=""blue""><i>(555)555-1212office</font><BR>" omail.HTMLBody = omail.HTMLBody & "<font face=""Times New Roman"" size=""2"" color=""blue""><i>(555)555-1313 fax</font><BR>" omail.HTMLBody = omail.HTMLBody & "<a href=mailto: "Me.UserEmail" omail.Configuration.Fields.Update omail.Send MsgBox "Status Update Sent" Set omail = Nothing Set oMailConfig = Nothing Exit Sub errHandler: MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & _ VBE.ActiveCodePane.CodeModule, vbOKOnly, "Error" End Sub