473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Please help... "Transport failed" error.. sending email using ASP

Hi all,

I am a complete newbie to ASP and am trying to send email from my gmail account to another gmail ID. Is it possible? I have my computer with no mail server installed. i have IIS installed and working. i have used the following code. I am getting the error..

CDO.Message.1 (0x80040213)
The transport failed to connect to the server.

the error is throwing at '.Send' line. the actual mail IDs given in from and to are real and existing ones... Please help me out..

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Mail send</title>
  4.  
  5. <% 
  6.     sch = "http://schemas.microsoft.com/cdo/configuration/" 
  7.  
  8.     Set cdoConfig = CreateObject("CDO.Configuration") 
  9.  
  10.     With cdoConfig.Fields 
  11.         .Item(sch & "sendusing") = 2 
  12.         .Item(sch & "smtpserver") = "smtp.gmail.com" 
  13.         .update 
  14.     End With 
  15.  
  16.     Set cdoMessage = CreateObject("CDO.Message") 
  17.  
  18.     With cdoMessage 
  19.         Set .Configuration = cdoConfig 
  20.         .From = "myemail1@gmail.com" 
  21.         .To = "myemail2@gmail.com" 
  22.         .Subject = "Sample CDO Message" 
  23.         .TextBody = "This is a test for CDO.message" 
  24.         .Send 
  25.     End With 
  26.  
  27.     Set cdoMessage = Nothing 
  28.     Set cdoConfig = Nothing 
  29. %>
  30.  
  31.  </head>
  32.  
  33. <body>
  34.  
  35. </body>
  36. </html>
Thank u in advance..
Jan 31 '08 #1
8 6717
DrBunchman
979 Expert 512MB
Hi there,

You can follow these steps to send mail from your machine.

First you need to install default smtp server on your IIS. To do this go to Control Panel...Add/Remove Programs...Add/Remove Windows Components, select Internet Information Services and click details. There will be an smtp check box which you need to select then click next.

Now all you need to do is change one line in your code:

.Item(sch & "smtpserver") = "smtp.gmail.com"

becomes:

.Item(sch & "smtpserver") = "127.0.0.1"

This will send the mail from your smtp but it will appear in the inbox as being from whichever from address you specify. This does mean that any mail you send out will not appear in a 'Sent Items' box.

I hope this helps but if you have any problems then please let me know.

Good luck,

Dr B
Feb 1 '08 #2
Hi there,

You can follow these steps to send mail from your machine.

First you need to install default smtp server on your IIS. To do this go to Control Panel...Add/Remove Programs...Add/Remove Windows Components, select Internet Information Services and click details. There will be an smtp check box which you need to select then click next.

Now all you need to do is change one line in your code:

.Item(sch & "smtpserver") = "smtp.gmail.com"

becomes:

.Item(sch & "smtpserver") = "127.0.0.1"

This will send the mail from your smtp but it will appear in the inbox as being from whichever from address you specify. This does mean that any mail you send out will not appear in a 'Sent Items' box.

I hope this helps but if you have any problems then please let me know.

Good luck,

Dr B

Thanks Dr B!
I checked my IIS details.. the smtp check box is already checked. i changed the smtpserver from smtp.gmail.com to 127.0.0.1. Now, it is throwing the following error at the same line:

(0x80040211)

Plzzzz help.. thanks a lot!
Feb 1 '08 #3
DrBunchman
979 Expert 512MB
Ah...there are a couple of things which I know of that you can check:
  • Check that your default smtp port is set to 25. If you go to the properties of your smtp in IIS (from running inetmgr) and click on the advanced button of the general tab it will show you which port you are using.
  • Have you got any kind of firewall or anti virus software running? McAfee and things like that can sometimes block smtp on port 25.
I'm sorry to say that smtp can be a real pain to get configured sometimes but i'm sure we'll get it cracked!

Dr B
Feb 1 '08 #4
Ah...there are a couple of things which I know of that you can check:
  • Check that your default smtp port is set to 25. If you go to the properties of your smtp in IIS (from running inetmgr) and click on the advanced button of the general tab it will show you which port you are using.
  • Have you got any kind of firewall or anti virus software running? McAfee and things like that can sometimes block smtp on port 25.
I'm sorry to say that smtp can be a real pain to get configured sometimes but i'm sure we'll get it cracked!

Dr B
Still the same case! :( Checked both the above steps.. but still getting the same error.. i got some link..

http://www.gulfstreamway.com/dss/company/xlinesoft/ticket/ViewKBArticle.asp?folder=xlinesoft&aid=74&catid=27 &f=1&vc=1&asktx=

followed the steps given there too.. but still not working :(
sorry if i am bugging.. wat can be done now??
Feb 3 '08 #5
Another problem now.. :(

Hey the error is solved somehow.. but the mail is not getting delivered.. it is getting saved in C:\Inetpub\mailroot\Queue folder. :(
Feb 4 '08 #6
JamieHowarth0
533 Expert 512MB
Hi kpdeepu,

Are you running this on your machine at home or on paid-for webspace of some kind, and if the former, what type of Internet connection do you have?

medicineworker
Feb 6 '08 #7
Hi kpdeepu,

Are you running this on your machine at home or on paid-for webspace of some kind, and if the former, what type of Internet connection do you have?

medicineworker

Hi medicineworker,

i am running this on my office computer.
Feb 6 '08 #8
JamieHowarth0
533 Expert 512MB
OK, chances are your office uses some kind of DSL or cable service - which means you have a dynamic IP.

One of the adopted "laws" of the Internet by many ISPs is that of refusing mail from mail servers with dynamic IP addresses (commonly used by domestic ISPs). The reason is that 99% of mail sent by mail servers with a dynamic IP is produced by "botnet" software using your home PC as an email powerhouse to send out trash advertising discount Viagra and 419 fake lottery scams. This can be very frustrating for the small business or the avid tech home-user who wants to run a website and email server from home or on a cheap Internet connection (like me!).

My suggestion - either ask your ISP for permission to relay through their server or use a third-party company to relay. I use DNSExit and highly recommend their prices, although have had service issues previously.

Once you have found someone who will let you relay mail, the next thing to do is set up the relay so that every time an email is sent from your SMTP server (e.g. using ASP CDO).

Open Internet Information Services on your PC and go to "Default SMTP Virtual Server". Right-click on it and select Properties > Delivery. Click on the "Advanced..." button, and in the "Smart host" box, enter the address of the server that you will be relaying mail on to.

The idea of a relay server is literally to send mail onto a server but not alter any of the "to" or "from" fields - so it retains your email address and not that of your ISP!

Also make sure that if you have a firewall on your company network, that port 25 is open.

Hope it helps!

medicineworker
Feb 6 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stefan Rijkaart | last post by:
Hello, has anyone experienced problems with XMLRPC library when trying to connect through authentication? I am calling a service on (example):...
0
by: Bon | last post by:
Hello All I got "Tables are skipped or export failed" error when I used upsizing wizard on migrating MS Access 2000 to MS SQL Server 2000. I am changing my application backend database from MS...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
1
by: John Dalberg | last post by:
Running Crystal Reports with the hotfixes and patches & VS 2003. I created a CR report on my development server which has SQL Server. The report runs fine inside Visual Studio. When I switched...
1
by: Roy | last post by:
Hey all, I have a VB App which uses the bundled version of Crystal Reports for VS.NET 2003. It works fine in when I run it using VS *but* when I deploy it anywhere (including the development PC...
2
by: Jeff_Mac | last post by:
Hi there. I'm a bit of a newbie, and I would appreciate any help that anyone can give me on an error I'm getting with Crystal Reports. Every time I attempt to view a report using the Crystal...
1
by: aaaaaa | last post by:
running a crystal (v10) reporting app on a virtual web server and getting the "Validation of viewstate MAC failed...." error when opening the crystal viewer. Any help please!!!
4
by: MadeOfRose | last post by:
Hi all i was using cdo object for sending email to a customers. when use win2000 server or windows xp my script works correctly. but not on win2003 server r2. Different thing on my script is...
0
by: t0nt0n | last post by:
i have an xp OS service pack 2 currently working on a project that uses ms access 2003 with mysql 5.0 backend... i get an odbc--call failed error when I manually changed the system date in my...
0
by: jianxin9 | last post by:
Hi everyone, I don't have a lot of experience with ASP and I was hoping someone could help me. I want to use our ASP form along with some javascript code to create a form where our patrons can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.