Hello everyone! Im new to ASP and this is my first time to work with it. Pls help me with my problem. I was given a tasks to edit an existing website (for 2 days only). One of those is sending e-mails based on a queried data from a database. The mail will be sent to the clients and the owner of the site. I have tried working on it but i have experienced error. pls help with my code. Below is my practice code.


PRACTICE CODE:

<%
dim msgMail as new MailMessage()
msgMail.To = "noel_c_cadiz@yahoo.com, dudegio@yahoo.com"
msgMail.From = "n.cadiz@spinweb.ph"
msgMail.Subject = "Email for Giraffe Stamps"
msgMail.Body = "Order Details
Stock Code: SG18
Stock Number : 193.018.2.3.1
Quantity: 1
Unit Price: $29.99
SHipping Price: $5
Total Price: $34.99
Total items: 1"

SmtpMail.SmtpServer="giraffestamps.com"
SmtpMail.Send(msgMail)
%>


ERROR:

Microsoft VBScript compilation error '800a0401'
Expected end of statement
/mailwithASP.asp, line 13
dim msgMail as new MailMessage()

Please help me troubleshoot and how am i going to do it. If you have the code the better. thanks. I very much appreciate any help. plsss... plsss... plsss... :(

Recommended Answers

All 4 Replies

Hello guys!
This one works but it only sends to this mail: mailObj.AddRecipient n.cadiz@spinweb.ph but in yahoo, no mail has been sent. May you please help me to loacte the problem with my code? plssssssssss.....

Set mailObj = Server.CreateObject("JMail.SMTPMail")
mailObj.Silent = true
mailObj.ServerAddress = "mail.spinweb.ph"
mailObj.Sender = noel_c_cadiz@yahoo.com
mailObj.ReplyTo = noel_c_cadiz@yahoo.com
mailObj.Subject = "Giraffe Stamps - Order Details"
mailObj.AddRecipient n.cadiz@spinweb.ph
mailObj.Body = "Hello"
If not mailObj.Execute then
sendEmail = -1
else
SendEmail = 0
End If

do you have a mail server? or ur iis o alowd to smtp?

Set mailObj = Server.CreateObject("JMail.SMTPMail")
mailObj.Silent = true
mailObj.ServerAddress = "mail.spinweb.ph"
mailObj.Sender = noel_c_cadiz@yahoo.com
mailObj.ReplyTo = noel_c_cadiz@yahoo.com
mailObj.Subject = "Giraffe Stamps - Order Details"
mailObj.AddRecipient n.cadiz@spinweb.ph
mailObj.Body = "Hello"

The problem here is that your sender's, replyto, etc. is not within quotes. So it willl not recognize it. Also, you can only send 1 email to 1 address at a time.

Try replacing this line, with the following:

mailObj.AddRecipient n.cadiz@spinweb.ph

with

mailObj.AddRecipient "noel_c_cadiz@yahoo.com"

And remember, "sender" is just the name of the person 'sending' the email, and "replyto" is the email address of the 'sender'.

Recipients are the only ones who will receive the email, and you can only send it to one recipient at a time.

try to look in yahoo mail spam.. i try this already and it i see it on spam.. not in inbox..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.