Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2004, 02:40 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default URGENT Error in sending mail

I am using IIS any one who tel me that weather I need any thing else if not then why this page is not working IT does not give any kind of error but just simply mail not send
<% @ Language="VBscript" %>
<% Option Explicit %>

<html>
<head>
<title>Message Sent</title>
</head>

<body bgcolor="#FFFFFF">
<%
'receive the values sent from the form and assign them to variables...
'declare the variables that will receive the values
'note that request.form("name") will receive the value entered into the textfield
'called name, and so with email and message
Dim name, email, message, NewMailObj

name=request.form("name")
email=request.form("email")
message=request.form("message")


'create the mail object and send the details
Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
NewMailObj.From = "michael@codefixer.com"
NewMailObj.To = request.form("email")
NewMailObj.Subject = "New message sent.."
NewMailObj.Body = "the name you entered was " & name & _
"<br>the email was " & email & _
"<br>the message was " & message

'you need to add the following lines FOR the mail to be sent in HTML format
NewMailObj.BodyFormat = 0
NewMailObj.MailFormat = 0
NewMailObj.Send
'Close the email object and free up resources
Set NewMailObj = nothing
%>
The email was sent.

</body>
</html>
__________________
(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is&nbsp;&nbsp;how you got it
 
Old June 11th, 2004, 02:51 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi qazi_nomi,

I think it would help if you'd define "not working". What exactly does not work? Do you get an error?

Without this kind of information, people on this forum cannot help you.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 11th, 2004, 03:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi qazi_nomi,

Does not work is so generic. I am not sure what you mean by saying that. It is hard to troubleshoot based on that.

what are the ways you troubleshooted this? And what all errors you came across before saying so.

IMO. if you see The email was sent on this page, this works perfectly, unless you say what is does not work

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 11th, 2004, 04:25 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

It donot give any kind of error but simple is that it do not send mail

Love 4 all
 
Old June 11th, 2004, 05:56 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

Three things.

1. If the from address is not a valid email address, mails may not go.

2. This may be because of relay problem. Some mail servers may block mail from unknown email addresses. If the address michael@codefixer.com is not set as a valid mail, it won't send mail from this address. I don't know the exact problem. But this happened for me many a time. Mail server administrator then corrects this by accepting the from address from me.

3. You have not put the HTML content between <html> and </html> tags. Actually you need to put the body as

<html><head><title>Subject of mail</title></head><body>content of mail in HTML format</body></html>

It may be working without this <html> tags. But not all mail clients will display the message as you want.
 
Old June 11th, 2004, 09:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi qazi_nomi,

Check if you have setup an SMTP service on the machine that runs IIS. If not installed, set that up. Else this will not work as expected.
The Simple Mail Transfer Protocol (SMTP) service must be enabled and configured in order to use CDONTS. (See the Internet Information Services documentation for details.)

Madhukp,
I don't agree with this point.
Quote:
quote:1. If the from address is not a valid email address, mails may not go.

2. This may be because of relay problem. Some mail servers may block mail from unknown email addresses. If the address michael@codefixer.com is not set as a valid mail, it won't send mail from this address. I don't know the exact problem. But this happened for me many a time. Mail server administrator then corrects this by accepting the from address from me.
I have been using fake/non-exisiting FROM emails to send out mails and that works. Something like "test@test.com" was the one used first to test the script when it was in development stage. So that shouldn't be a reason.

A simple example on this. Everyone gets huge number of spam mails on our yahoo/hotmail inboxes everyday. Same content comes with different from email addresses on different days and one can never set FILTER for deleting them all automatically still. Do you think these are all having a valid from address? Try replying to them, you would get your reply bounced back to you, saying they are all not valid addresses. Still how can they spam us? Why don't yahoo/hotmail have one such mail server so that we can all be safe from spams;)

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 24th, 2004, 05:41 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,
 I have the same problem. i am trying to send email using CDONTS from a website i am developing. The problem is it doesnt send email and gives no error.
 The code is below

Code:
dim dids, mail
dids ="vishnu_nitu@yahoo.com"


Set Mail=Server.CreateObject("CDONTS.NewMail") 

Mail.To=dids
Mail.From="serge@xyz.com" 
Mail.Subject="S10 Technology" 
body="S10 Technology"
Mail.Body="Dear Dr. Bigler "  & vbcrlf &_
"     You have been assigned a new request from xyz" & vbcrlf &_

"Please review the request as soon as possible."  & vbcrlf &_
" Thanks "   
 
 Mail.Send 
 Set Mail=nothing 
 
response.redirect("SentMail.asp")
I am using the domain name of "From" mail same as that of the domain name of the website (and i actually have that email registered with them)

There is no error and "sentmail.asp" page is executed.

As someone mentioned to do some setting in their smtp server, how can i do it? i dont have access to their server.

thanks in advance

 
Old June 25th, 2004, 12:38 AM
Authorized User
 
Join Date: Jun 2004
Location: , , India.
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to silver_cuts Send a message via Yahoo to silver_cuts
Default

Hello everybody,

well i am facing the same problem ... but i know a bit more about this problem ....

what is happening is that the MAIL doesnt go but gets accumalated in the DROP or the QUEUE folder ...

i have double checked the TO,FROM and other settings and even the SMTP settings but what i got last was ....

(1) mail for the internal domain go the the DROP folder in form of files having an extention ".eml"

(2) mail for the external domains go to the QUEUE folder and for each of them 3 files are created -
    - one is the email file with extention ".eml"
    - another is and HTML webpage
    - and then there is a ".ctl" file called CERTIFICATE TRUST LIST

Well this ".eml" file opens with the mail agent like OUTLOOK
but the other 2 files hold weird kind of values which i couldnt PARSE

These DROP and QUEUE folders are present in the MAILROOT folder ...

i have been trying to get rid of this stuff for about 2 weeks but without any luck ...

only one thing that i found out during this time was that if at all there is any ERROR in SETTINGS then the messages go to the BADMAIL folder in the same MAILROOT directory in form of 3 files ...

     - one having ".bad" extention
     - one having ".bdr" extention
     - one which contains just the text of the mail

the .BAD and .BDR files contain lot of values from which i was once able to find out that my SMTP settings where incorrect ....

Well so QAZI find out if your mails are present in one of the above folders ...

As for IMAR, VIJAY, MADHU ... plz help ....

thanks in advance ...

Sudhan.

 
Old June 25th, 2004, 12:57 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

What I mean is : The mail server may be configured to send mails from known addresses only.

From the local server the mails will go even if the from address is fake. But the production servers use mail relays and other protective mechanisms. They will block the mails from / to unknown addresses. I had this experiences atleast 3 times when the files are moved to production servers.

The mailservers of most of the free email services are using "Open relays" which will permit mail to / from any addresses. But that is not the case with the mail server at a company. It may be using mail relay.

In the above example posted by iniro, I also see the to address to be invalid (just dids).

Please go through the following links to understand open relay and mail relay.

http://www.webopedia.com/TERM/O/open_relay.html

http://www.webopedia.com/TERM/M/mail_relay.html

While configuring mail relay mail server administrator have to incluide the valid from addresses. This mail server will forward only mails from these addresses.

And I am sorry Vijay, but I cannot agree with you. There is definitely a problem called Relay problem.
 
Old June 25th, 2004, 01:41 AM
Authorized User
 
Join Date: Jun 2004
Location: , , India.
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to silver_cuts Send a message via Yahoo to silver_cuts
Default

Everybody,

plz read my above post and tell me if anyone can help ...

Sudhan.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when sending mail using the AjaxMail example MightyThor BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 June 23rd, 2006 04:11 AM
Mail sending error rajuru Beginning PHP 3 October 20th, 2004 01:19 AM
Urgent Error in sending mail qazi_nomi Classic ASP Components 1 June 11th, 2004 02:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.