473,594 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Errors:
An unhandled exception of type 'System.Web.Htt pException' 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_*********@ya hoo.com>"
Message.From = "Order System <m_*********@ya hoo.com>"
Message.Body = "Attachment : text file"
Message.Subject = "Your Request"
Message.Attachm ents.Add(attach ment)
System.Web.Mail .SmtpMail.SmtpS erver = "mail.company.l ocal"
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 11068
* m_*********@yah oo.com (m_evergreen) scripsit:
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll

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


Did you already have a look here?

<URL:http://www.systemwebma il.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)("Cu stomerID") & tbl.Rows(A)("Fi lterID") &
".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.GetCu rrentDirectory( )
filename = direct & tbl.Rows(A)("Cu stomerID") & tbl.Rows(A)("Fi lterID")
& ".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
2921
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; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en
1
6686
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 specified protocol is unknown. web server information
3
24941
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 whether the cdoSMTPServerPickupDirectory field of the Message object defaults and whether it's normal to have to set this value explicitly. My W2K workstations and servers function OK without this
2
2157
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 error.Could you suggest me anything in this matter. Thank you, Sunny try
3
2236
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 with a number of files. The information, including the file is stored in the database, and an email is sent with the information and any files that were submitted are attached. The system works fine when a user makes a submission that has no...
0
1709
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 get this exception: System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException...
1
2373
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 convert the code to PHP have ended in frustration so far. It seems when I search, all roads point me to PEAR's Mail_mimePart, but I am not understanding the example code enough to try to use it. Can someone help me start to figure out how this code...
3
2392
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 not authorized" i have configure smtp server put 127.0.0.1 ip in relay and also put 127.0.0.1 ip in connection. using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing;
1
2554
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 = "xxx\@xxxxx.com.br"; my $subject = "ficheiro audio "; my $message = "ficheiro audio "; my $path = "/home/user/Desktop/outputs/20080101_titulo-teste.mp3";
0
7936
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7874
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8241
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7997
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6646
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3853
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1469
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.