ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 20th, 2003, 01:00 AM
sachinborkar sachinborkar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 99 sachinborkar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 12 m 17 sec
Reputation Power: 5
Exclamation EmailAttachment

Hi!
Below is the asp script for sending email with attachment.When I run the script without including objMail.AttachFile("C:\0102.txt"), it
works fine, message goes successfully to the receipent.But if I include objMail.AttachFile("C:\0102.txt") in the script, on executing it gives "The Page cannot be displayed".Also email does'nt go the receipent.

<%
Option Explicit

Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")

objMail.From = "xyz@hotmail.com"
objMail.Subject = "A message TO you"
objMail.AttachFile("C:\0102.txt")
objMail.To = "xyz@yahoo.co.in"
objMail.Body = "This is the body of the Message"
objMail.Send

Response.write("Mail was Sent")

set objMail = nothing
%>

How to rectify the above problem?

Regards
Sachin

Reply With Quote
  #2  
Old November 20th, 2003, 01:21 AM
unclefu unclefu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 120 unclefu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 57 sec
Reputation Power: 5
in internet explorer goto tools > internet options > Advanced (tab) and uncheck the option that reads:

Show friendly HTTP error messages

then post what error message you get (if it's more detailed)

also - i know this doesn't really help - but if you comment out the line with .AttachFile , can you send mail? If so then maybe it has something to do with file permissions.

and lastly to make your life easier in the future you can do:

<%

with objMail
.From = "xyz@hotmail.com"
.Subject = "A message TO you"
.AttachFile("C:\0102.txt")
.To = "Xyz@yahoo.co.in"
.Body = "This is the body of the Message"
end with

objMail.Send

...

%>

also i found this on another website:
Quote:
Quick Note: If you get an error and you have. "Run in separate process" checked under your Application settings in the IIS Console try turning that off for that web or search the Online Microsoft Knowledge Base for a description of the fix. The fix for making CDONTS work with "Run in separate process" checked is a catch 22 situation involving security risks. Unfortunately I can longer find that article and can not tell you how to do it since I don't really remember it at all.


hope some of that helps

Reply With Quote
  #3  
Old November 20th, 2003, 01:39 AM
sachinborkar sachinborkar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 99 sachinborkar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 12 m 17 sec
Reputation Power: 5
If I comment .attachfile email goes successfully.As per suggestion, I unchecked "Show friendly HTTP error messages" and tried executing the script with .attachfile uncommented.
It gives following error :

error '80004005'
Unspecified error
line 10

Reply With Quote
  #4  
Old November 20th, 2003, 10:17 AM
unclefu unclefu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 120 unclefu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 57 sec
Reputation Power: 5
well i googled the error and i came up with a few interesting things

1st.. there's a new object you can use for sending mail (as of Windows 2000 and higher - so if your host is on NT4 you'll have to use CDONTS) -- CDOSYS

CDOSYS Tutorial

For reference purposes here's Microsoft's Help on the CDOSYS object

Also I'd recommend taking a look at this google post as it has some information that may be helpful to you.

And I'd recommend you check out this list of usenet posts on google .

Hope some of that helps.

Aside from the use CDOSYS suggestion, there's a few others I read, such as changing the file permissions on the file and/or directory of the file you're sending. As well as modifying the SMTP settings in IIS (the first link has some information on changing those settings as well as what they possibly should be set to).

good luck with the problem

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > EmailAttachment


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway