473,324 Members | 2,531 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,324 software developers and data experts.

SMTP Email problems

The following line of code :
SmtpMail.Send(objEmail)

Produces this error :
"System.Runtime.InteropServices.COMException: Unspecified
error"

Can anyone help ?

I have included "Imports System.Web.Mail" at the top of my
code behind page and intelisence reveals all appropriate
properties and methods.
Nov 20 '05 #1
4 2101
Cor
Hi Poppy,
I think the simplest thing to find it is to add a try, catch end try block.
I would in this situation put an extra label on my webform and then:
\\\
Dim objMail As New MailMessage()
..
..
..

Try
SmtpMail.Send(objMail)
extralabel = "mail is send"
Catch exp As Exception
extralabel = "A problem occurred: " & exp.Message
End Try
///
Your mail is not send, but you get probably some more information.
Just a try,
Cor
Nov 20 '05 #2
Hi Poppy,

Here's a few lines of code that works just fine. One of the things you
might want to investigate is if the .from address is valid and working
properly and also check the smtpmail.smtpserver address and working status:
Dim msg As New MailMessage()

msg.To = "be*****@optonline.net"

msg.From = "be*****@cherwellinc.com"

msg.Subject = "test subject"

msg.Body = "this is the test info"

Dim astring1 As String = "c:\my documents\wzo letter.doc"

msg.Attachments.Add(New MailAttachment(astring1))

Dim astring2 As String = "c:\my documents\visual basic notes.doc"

msg.Attachments.Add(New MailAttachment(astring2))

msg.Cc = "we*******@cherwellinc.com"

SmtpMail.SmtpServer = "smtp.registeredsite.com"

Try

SmtpMail.Send(msg)

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

HTH,

Bernie Yaeger

"Poppy" <pa**********@themedialounge.com> wrote in message
news:06****************************@phx.gbl...
The following line of code :
SmtpMail.Send(objEmail)

Produces this error :
"System.Runtime.InteropServices.COMException: Unspecified
error"

Can anyone help ?

I have included "Imports System.Web.Mail" at the top of my
code behind page and intelisence reveals all appropriate
properties and methods.

Nov 20 '05 #3
Cor
Bernie,
Not on a code behind page from a webform I think.
The messagebox will throw an error as well.
Cor
Nov 20 '05 #4
Hi Poppy, could you please post your code that initializes the MailMessage
class?

Thanks.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Poppy" <pa**********@themedialounge.com> wrote in message
news:06****************************@phx.gbl...
The following line of code :
SmtpMail.Send(objEmail)

Produces this error :
"System.Runtime.InteropServices.COMException: Unspecified
error"

Can anyone help ?

I have included "Imports System.Web.Mail" at the top of my
code behind page and intelisence reveals all appropriate
properties and methods.

Nov 20 '05 #5

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

Similar topics

2
by: RandRace | last post by:
I'm having some problems with a little script i wrote using net::smtp. I originally wrote it in linux where it works perfectly. I tried to use it from windows the other day and it doesn't work. It...
2
by: David | last post by:
Hi Group, I'm having a few problems with getting an SMTP server configured on my Windows 2000 Server web server. My web server is co-located at my hosts and i use VNC to remotely access the web...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
1
by: Srinivas | last post by:
Hi, I am using ASP.NET SmtpMail to send email using the following code public void SendEmail(string From, string To, string Subject, StringBuilder Message, string Attachment, string...
1
by: madfisher | last post by:
Hi, I am trying to send email via a ASP .NET page using the local SMTP virtual server. My mail items go in the Queue but do not get sent out. Can this be done this way, or do I need a true email...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
2
by: oliu321 | last post by:
Hi, First I am not trying to write a client to talk with hotmail straightly. I am trying to write some codes to send emails through a SMTP server. I wrote a C++ version using pure socket...
9
by: Ted Boyd | last post by:
I have an ASP page that sends email using CDOSYS. If there is any type of failure that causes the email not to be sent, I don't have any way of knowing it. Is there any email component that will...
8
by: Marty | last post by:
I'm having issues sending an email to an "@page.nextel.com" email address. I can send to any other email address fine, but when I try the page.nextel.com it gives me this error: ...
4
by: Brian | last post by:
Hello all, we don't actually host our own server but still should work the same. Here is the error message i get "error mailbox unavailable. The server response was: must be authenticated code...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.