i m new to asp . i m try to send mail using CDO. my os is XP pro. i have install IIs and smtp also running. if i running my program , its doesn't throw any error. but my mail is not sent.. that is , if i m checking my inbox, mail is not there. i don't know what is the problem . anybody help me.

here is my coding

<%
Set myMail=Server.CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From=""
myMail.To="
This is a message."
myMail.send
set myMail=nothing
response.write("<b>Mail send</b>")
%>

Dani AI

Generated

: the symptom "no error but no mail received" usually means ASP/CDO handed the message to the SMTP subsystem but the SMTP server never delivered it. fixed the ASP syntax (that gets the message to SMTP). correctly warned about modern anti-spam — many public providers will reject mail from unauthenticated hosts or from dynamic/home IPs.

Quick practical checks

  • Look in the local SMTP folders (default IIS SMTP: C:\Inetpub\mailroot\Pickup and C:\Inetpub\mailroot\Queue) to see whether messages are being queued or stuck.
  • Enable and inspect SMTP logging and Windows Event Viewer (Application/System) for delivery errors or authentication failures.
  • Verify the SMTP server allows relay from localhost (127.0.0.1) and that firewall/ISP are not blocking outbound SMTP (port 25 or submission ports 587/465).
  • If the message leaves the queue but never arrives, check remote SMTP response codes in the logs (they explain whether the remote server rejected it).

If the local SMTP cannot relay, configure CDO to use an authenticated SMTP relay (ISP or service) instead of relying on the machine as a mail server. Example configuration (replace host/credentials as needed):

<%
' configure CDO to use an authenticated SMTP relay
Set cfg = Server.CreateObject("CDO.Configuration")
With cfg.Fields
  .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com"
  .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
  .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
  .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
  .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
  .Update
End With
' assign cfg to the message before Send
%>

Deliverability notes and cautions

  • Use an authenticated sender address that matches the relay account; many hosts drop mail that spoofs domains.
  • For reliable delivery to Yahoo/Hotmail/Gmail, use an authenticated relay or a reputable transactional SMTP service, and publish SPF/DKIM for the sending domain.
  • If testing on Windows XP, consider testing the same code on a server OS or against a known external SMTP relay to isolate OS/service limitations.

Recommended Answers

All 4 Replies

Member Avatar for Member #114696

well the code you have written is wrong:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="This is the subject"
myMail.From="vishesh91@@hotmail.com"
myMail.To="vishesh91@msn.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

Thank U vishesh,

i will try this coding.

can i sent mail to yahoo,hotmail without any configuation.

if so, plz can u tell and help me????????


well the code you have written is wrong:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="This is the subject"
myMail.From="vishesh91@@hotmail.com"
myMail.To="vishesh91@msn.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

hi there
i tried this long before but dont know abt current udates regarding winxp.
but last time when i tried this, i found that there are certain librries not present in XP, s these kind of fatures are not supported.
you first try to use your code in windws2000 withount any change, it might work there.

yahoo/hotmial and other mail ervers has started new technique known as antispam, so these new domains wont be able to sent mails to these server unless you register your domian through process.

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.