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

Asp.net sending Email Problem

Hello

I am using Window Small Business Server and MS Exchange Server act as the SMTP server. I wrote a web application for sending email to others. It works fine in XP, but error appears in the Small Business Server

Here is the code:
Public Function sendMail(ByVal mailTo As String, ByVal mailFrom As String, ByVal subject As String, ByVal content As String, ByVal priority As String)
Dim mail As New MailMessage
mail.BodyFormat = MailFormat.Text
mail.To = mailTo
mail.From = mailFrom
mail.Subject = subject
mail.Body = content
SmtpMail.SmtpServer = "127.0.0.1"
SmtpMail.Send(mail)
End Function

Error Message:
Could not access 'CDO.Message' object. Exception has been thrown by the target of an invocation. The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available

Please help
Aug 24 '06 #1
4 2238
define namesapace for cdo.message object

i.e System.Web.Mail
Aug 25 '06 #2
I have done that already.

"Imports System.Web.Mail"

Error still occur.....
Aug 28 '06 #3
please check the two points

1. check the IP

2. check the content of your mail body

if you are using something like
"this first line of message \n this is the second line"

then chenge it to

"this first line of message \r\n this is the second line \r\n"
Apr 17 '07 #4
Frinavale
9,735 Expert Mod 8TB
I've found in the past that sometimes vague error messages are thrown like this if the mail server could not authenticate the user credentials.

Does your email server require email user credentials in order to log in to use the email services?

If so, I'd try something like:
Expand|Select|Wrap|Line Numbers
  1.     Dim port as Integer = 25
  2.     Dim emailTitle As String = "Title"
  3.     Dim body as String = "This is the body of my email"
  4.  
  5.     Dim emailMessage As New Net.Mail.MailMessage("me@ToEmailAddress", "me@FromEmailAddress", emailTitle, body)      
  6.  
  7.     Dim mailClient As New Net.Mail.SmtpClient("emailServer", port)
  8.  
  9.     Dim myCredentials As New System.Net.NetworkCredential("EmailUserName","EmailPassword")
  10.  
  11.     mailClient.UseDefaultCredentials = False
  12.     mailClient.Credentials = myCredentials
  13.     mailClient.Send(emailMessage)
  14.  
  15.  
Hope this helps!

-Frinny
Apr 17 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
6
by: Owen | last post by:
I am sending email using CDO but it only seems to work when the "To" address is within the same domain as mine. When I send to an outside domain (eg. yahoo.com) the mail simply does not reach...
2
by: Mark | last post by:
I have a service that I've built that runs on our web server. The web service has a reference to the System.Web namespace so it can use the classes titled: MailMessage SmtpMail My web...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
5
by: Mark A. Sam | last post by:
Hello, I am sending two emails from the same procedure, one to myself (while testing) and another (a comfirmation) to the user on the website. I was having difficulty finding a relay server to...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
0
by: Vajrala Narendra | last post by:
in the i got few problems please solve to help me also send information regarding email sending. Try Dim mailbody As String mailbody = "" mailbody =...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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.