473,387 Members | 1,678 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,387 software developers and data experts.

The specified protocol is unknown. Error while trying to send email with attachment.

Errors:
An unhandled exception of type 'System.Web.HttpException' occurred in
system.web.dll

Additional information: Could not access 'CDO.Message' object.

innerexception is "Exception has been thrown by the target of an
invocation."

innerexception.innerexception is "The specified protocol is unknown."

I experimented, removing the attachment references and the error goes
away, the email is sent, and recieved. My code for sending the mail
with attachment looks like this:

Dim attachment As New System.web.mail.MailAttachment(filename)
Dim Message As New System.Web.Mail.MailMessage
Message.To = " <m_*********@yahoo.com>"
Message.From = "Order System <m_*********@yahoo.com>"
Message.Body = "Attachment: text file"
Message.Subject = "Your Request"
Message.Attachments.Add(attachment)
System.Web.Mail.SmtpMail.SmtpServer = "mail.company.local"
System.Web.Mail.SmtpMail.Send(Message)

I'm beginning to suspect that the problem may stem from this actually
being a windows application instead of a web application. I imported
System.Web references which includes System.Web.Mail of course. Is
there something else I need in references?

Let me know if more code is needed to troubleshoot. Thank you.
Nov 20 '05 #1
2 11002
* m_*********@yahoo.com (m_evergreen) scripsit:
An unhandled exception of type 'System.Web.HttpException' occurred in
system.web.dll

Additional information: Could not access 'CDO.Message' object.


Did you already have a look here?

<URL:http://www.systemwebmail.net/>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Thank you, I've found a fix for the problem. I started by adding c:/ to
my file name, giving me something like this:

filename = "c:/" & tbl.Rows(A)("CustomerID") & tbl.Rows(A)("FilterID") &
".txt"

This worked on my machine but I was concerned that it might not work on
the server. After giving it some thought I changed the code again
adding to the top:

Imports System.io

and then later in the code:

direct = Directory.GetCurrentDirectory()
filename = direct & tbl.Rows(A)("CustomerID") & tbl.Rows(A)("FilterID")
& ".txt"

I hope this will help anyone in a similar situation.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
1
by: Fahad | last post by:
I am trying to send an e-mail using CDO I get this message when trying to send an e-mail. I am using the object Set ObjMsg = Server.CreateObject("CDO.Message") CDO.Message.1 (0x800C000D) The...
3
by: Alan Howard | last post by:
Hi there, I can't seem to find any info on this error message that's generated when sending email with CDO: "The pickup directory path is required and was not specified" Does anyone know...
2
by: Sunny | last post by:
Hi, I am new in development. I want to develop a application which send email from yahoo acoount to rediffmail acount I am trying following Code But its giving Server 530 Authetication...
3
by: Brian Farnhill (MCP VB.NET) | last post by:
Hi, I am having some trouble using the MailMessage object to send an email with more than one attachment. I am working on a web based application where a user can submit information, along...
0
by: Jerry Camel | last post by:
Let's try this again... I think I sent half a message before. Things were working just fine and I'm not sure what changed. The code is pretty simple. But now I can't send a message anymore. I...
1
by: hmbscully | last post by:
I am trying to send a complex mutli-part email with inline attachments between html pieces. I originally wrote the code in Perl with the MIME::Lite module, which worked fine. My attempts to...
3
by: raj200809 | last post by:
when i m sending mail i received error from symantec Antivirus" Your email message was unable to be sent because your mail server rejected the message 550-5.7.1 the ip you’re using to send mail is...
1
by: jcor | last post by:
Hi, I'm trying to create a script that send a file in attachment of a mail: my code is something like this: #set up email my $to = "xxx\@xxxxxx.com"; my $from =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.