Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function sendRegistrationEmail(FormData)
- Set cdoMessage = CreateObject("CDO.Message")
- cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
- cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Application("MailServerHostName")
- cdoMessage.Configuration.Fields.Update
- mailBody = "Thanks for subscribing!" & VbCrLf & VbCrLf &_
- "By subscribing to Lennox Innovations and our Get Connected e-newsletter, you'll be among the first to learn about the latest innovations in commercial comfort. You'll also get a wide range of ideas for improving your efficiency and protecting your bottom line." & VbCrLf & VbCrLF &_
- "Remember to add lennox@lennox.com to your address book to ensure delivery to your inbox." & vbCrLf & vbCrLf &_
- "Lennoxcommercial.com." & vbCrLf & vbCrLf &_
- "If you do not wish to receive further e-mails from Lennox, you can opt-out at any time. We will promptly remove your name from the mailing list." & vbCrLf & vbCrLf
- mailRecipients = """" & FormData("userFirstName") & " " & FormData("userLastName") & """ <" & FormData("userEmail") & ">"
- If NOT Application("IsLive") Then
- mailRecipients = mailRecipients & ", ""Nick Wunderlin"" <nwunderlin@powercreative.com>"
- End If
- With cdoMessage
- .From = "Joey.Gennari@Lennoxintl.com"
- .To = mailRecipients
- .Subject = "Welcome from Lennox Commercial"
- .TextBody = mailBody
- End With
- On Error Resume Next
- cdoMessage.Send
- If Err.Number = 0 then
- Success = TRUE
- Else
- errorNumber = Err.Number
- cdoerrorMessage = Err.description
- Success = TRUE
- ' let's set this to ALWAYS TRUE -
- ' even if we don't get to send the email due to error
- ' we can still make the subscription process suceed to the user
- End If
- Set cdoMessage = Nothing
- Set cdoConfig = Nothing
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement