|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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:
hope some of that helps |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > EmailAttachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|