Link to home
Start Free TrialLog in
Avatar of ovlea1
ovlea1

asked on

send an automatic e-mail to the some registered customers...with ASP

i have sql table with the customer's details that are registered to my website (which is not live yet by the way) and i need to send all these customers automatic e-mails to make them aware of the promotions, which are in HTML page.

how do i do this with ASP?

please help as it is quite urgent.

thanks a lot.xx
Avatar of Kiran Paul VJ
Kiran Paul VJ
Flag of India image


more links....
http://www.codeproject.com/asp/asp_send_email.asp
http://www.webwizguide.info/asp/tutorials/email_using_cdonts_tutorial.asp
http://www.w3schools.com/asp/asp_send_email.asp

get the customer details(name, email and others) from the SQL database and use with the code in the above links

hope this helps
kiranvj
Avatar of ovlea1
ovlea1

ASKER

i already downloaded the Jmail, and run the code but somehow it doesnt accept this line of code:
Set objJMail = Server.CreateObject("JMail.SMTPMail")
and it says the following:
Invalid class string.

as for the http://www.codeproject.com/asp/asp_send_email.asp link, where do i put the senders and receivers email, as well as how do i get the customers e-mails to send to?

sorry i might asking a lot, but as you can see my experience and knowledge is very poor.

xx
>>i already downloaded the Jmail

You don't need JMail.  What type of server are you using, and is it hosted by someone/some company?
Avatar of ovlea1

ASKER

windows xp proffessional, i have IIS installed, ASP and mySql.  no it is not hosted by any company.
Then you use CDOSYS.

See this link that kiranjv posted:
http://www.w3schools.com/asp/asp_send_email.asp

Avatar of ovlea1

ASKER

i have already tried that too but it keeps giving me this message:
The "SendUsing" configuration value is invalid.

on this piece of code:
myMail.Send

xx
SOLUTION
Avatar of alorentz
alorentz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
showing your code will help
Avatar of ovlea1

ASKER

well i am aure now that the smtp is not configured to send e-mails as everything that i try doesnts work but brings errors to do with failing of recognition of cdo when i try to set it.  at the moment i am trying to configure the smtp but the Internet Information Service doesnt have Properties when i right click on it.

so i am messed up big time, as nothing seems to be working.....

x
Go here and get the components tests.  It has a way to not only show COMs running on your system, there is a way to test your mail configuration.

http://www.pensaworks.com/prg_com.asp
Open IIS....do you see Default SMTP Virtual Server?

Seems like you're able to run ASP pages so IIS is working.

some times these things will not work in localhost. try uploading to some server and check.
i think its some configuration problem with the SMTP server in the localhost.

if possible plz post ur code.
Avatar of ovlea1

ASKER

yes it is there, but still dont know what am i doing wrong...so when my code is as folows:#1
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="artur_trumci@yahoo.co.uk"
myMail.To="ovlea@yahoo.co.uk"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
#it says The "SendUsing" configuration value is invalid -- on this piece of code.

when i use this other code: #2
<%
Sub send_email(email_from, email_to, email_subject, email_body)
    Dim Newmail
    Set Newmail = server.CreateObject ("cdonts.newmail")
   
    Newmail.BodyFormat = 0
    Newmail.MailFormat = 0
    Newmail.From = email_from
    Newmail.To = email_to
    Newmail.Subject = email_subject
    Newmail.Body = email_body
    Newmail.Send
      Call send_email("artur_trumci@yahoo.co.uk","ovlea@yahoo.co.uk","hi","there")
          
    Set Newmail = Nothing    
End Sub
%>
....nothing happens
#3 when i use this code:
    <%

    Dim myMail
    Dim HTML
    Set myMail = CreateObject("CDONTS.NewMail")

    HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
    HTML = HTML & "<html>"
    HTML = HTML & "<head>"
    HTML = HTML & "<meta http-equiv=""Content-Type"""
    HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
    HTML = HTML & "<meta name=""GENERATOR"""
    HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
    HTML = HTML & "<title>HTMLMail</title>"
    HTML = HTML & "</head>"
    HTML = HTML & "<body bgcolor=""FFFFFF"">"
    HTML = HTML & "<IMG SRC=""http://www.microsoft.com/library/"
    HTML = HTML & "images/gifs/homepage/microsoft.gif"" BORDER=0 "
    HTML = HTML & "WIDTH=167 HEIGHT=36 ALT=""Microsoft Corporation"">"
    HTML = HTML & "<p><font size =""3"" face=""Arial""><strong>"
    HTML = HTML & "Microsoft Exchange CDONTS Example</strong></p>"
    HTML = HTML & "<p><font size =""2"" face=""Tahoma"">"
    HTML = HTML & "CDO for NTS allows an easy way to send mail.<br>"
    HTML = HTML & "This example shows how the content can be "
    HTML = HTML & "an HTML page<br>"
    HTML = HTML & "which allows you to send rich text and"
    HTML = HTML & "inline graphics.</p>"
    HTML = HTML & "</body>"
    HTML = HTML & "</html>"

    myMail.From="someone@microsoft.com"
    myMail.To="someone@microsoft.com"
    myMail.Subject="Sample CDONTS HTML Message"
    myMail.BodyFormat=0
    myMail.MailFormat=0
    myMail.Body=HTML
    myMail.Send
    set mymail=nothing
    Response.Write "Message Sent"
    %>
an error -- as ActiveX component can't create object: 'CDONTS.NewMail' on this piece of code:    Set myMail = CreateObject("CDONTS.NewMail").

xx





ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ovlea1

ASKER

the first piece of code brings the following error:

The transport failed to connect to the server--on this line--myMail.Send.

and the ("http://schemas.microsoft.com/cdo/configuration/smtpserver")
 and other addresses used in the code dont open up anyway.

xx
They are not supposed to open up, they are just used for CDO...

Just put the code in EXACTLY as I showed, and try the different names or IP address for the server.
Avatar of ovlea1

ASKER

hi,
 
i tried them all, and if i put localhost, and the IP address 127.0.0.1 the following error comes up:
The transport failed to connect to the server ( for this line of code --> myMail.Send.

if i put the right machine IP address and name, as well as the right DNS name of my computer, then no error comes up but also nothing happens at all.

xx
Why are you running a recursive call to the sub?

Also, use CDOSYS as alorentz has shown.  If you're on W2K3 Server, CDONTS is not present and would explain the error.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial