Forum Moderators: open

Message Too Old, No Replies

aspemail

         

sukigill92

10:41 pm on May 6, 2003 (gmt 0)

10+ Year Member



I am tring to send an email to a recipient but i keep on getting the error.

Object doesn't support this property or method: 'mail.AddAddress'

i have the following code:

set mail = server.CreateObject("persits.mailsender")
mail.host = "smtp.ntlworld.com"

mail.from = "bill@bill.ge.com"
mail.FromName = "gill@gill.com"
mail.AddAddress = "fred@fred.com"
mail.AddCC = "jon@jon.com"

mail.subject = "eps Change control process - issue raised"
mail.body = "<HTML><HEAD></HEAD><BODY>"

mail.send
set mail = nothing

can anyone help out with what the problem is here?

RainMaker

12:03 am on May 7, 2003 (gmt 0)

10+ Year Member



Well what it sounds like is that when you instantiate the object mail it doesn't have functionality or implementation for method AddAddress, So I am thinking maybe you have something spelled wrong or there is a case sensitivity or something of that sort, when ever you type the "dot" in mail. it should come up with a list of properties or methods...if it doesn't have AddAddress then you need to initialize mail with another object or create an object that inherits that object. This is the best thing I can think of for that type of error.

korkus2000

12:16 am on May 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For

mail.AddAddress = "fred@fred.com"
mail.AddCC = "jon@jon.com"

Don't use an "=". You pass those to the method with out the "=".

mail.AddAddress "fred@fred.com"
mail.AddCC "jon@jon.com"

You can also add the name to them if you want like:

mail.AddAddress "fred@fred.com", "Fred Jones"
mail.AddCC "jon@jon.com", "Jon Fredrickson"

But the name is optional.

le_gber

8:07 am on May 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does your server support CDONTS?

If you have here's a sample code from a tutorial site:

' SEND EMAIL
Dim trixMail, trixBody

Set trixMail = CreateObject("CDONTS.NewMail")

trixBody="First Name: "& request.form("firstname") & vbcrlf
trixBody=trixBody & "Last Name: " & request.form("lastname") & vbcrlf
trixBody=trixBody & "E mail: "& request.form ("email") & vbcrlf

trixMail.From="mail@yourplace.co.uk"
trixMail.To="mail@yourplace.co.uk"
trixMail.CC=request.form("email")
trixMail.Subject="NEW ADDITION TO DATABASE"
trixMail.Body=trixBody
trixMail.Send
set trixMail=nothing

Tutorial page address: [webthang.co.uk...]

Doesn't work locally

Hope this helped

Leo

sukigill92

11:03 am on May 7, 2003 (gmt 0)

10+ Year Member



The email works now thanks for the help, I am currenly sending the email from a internet service provider server, would it be possible to run the email from the local machine?

CasperH

11:53 am on May 7, 2003 (gmt 0)

10+ Year Member



Yes you should...if you have your own webserver you simply install aspemail.

I you wish to buy the program you can find it at "programname".com (look above)
(not allowed to post the URL)

You migth wanna change the:
mail.host = "smtp.ntlworld.com"

to an open relay unless you have you own mailserver then you enter your own SMTP address

Does this make sence?

sukigill92

10:57 pm on May 7, 2003 (gmt 0)

10+ Year Member



Yes, cheers for the help.