Forum Moderators: open
The main code is:
While Not rs.EOF
Set sub_email = rs("email")
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mysite.com" ' Required
Mail.Port = 25 ' Optional.
Mail.FromName = "Newsletter from mysite.com"
Mail.From = "send@mysite.com"
Mail.AddAddress sub_email
Mail.UserName="send@mysite.com"
Mail.Password="cards"
Mail.Subject = my_subject
Mail.Body = my_message & rs("email")
On Error Resume Next
Mail.Send
But I get the following Type Mismatch error:
Type mismatch: 'AddAddress'
What am I doing wrong here?
It should not have the "=" sign.
Try this:
Mail.AddAddress sub_email, "John Smith"
John Smith, obviously, can be any name.
It might even work like:
Mail.AddAddress sub_email, ""
Addition:
I think the problem could be here:
Set sub_email = rs("email")
Why don't you do:
dim sub_email
sub_email = rs("email")