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

Can't send mail?

I'm getting this error when I try to send mail from my local machine:

The "SendUsing" configuration value is invalid.

Exception Details: System.Runtime.InteropServices.COMException: The
"SendUsing" configuration value is invalid

Here is the code I'm using:

string emailTo = "in**@abc.com";
string emailFrom = "in**@abc.com";
string emailSubject = "Message Inquiry";
string emailBody = "body here";
System.Web.Mail.SmtpMail.Send(emailFrom, emailTo, emailSubject,
emailBody);

When I upload this to the web server, I don't get an error but I don't
get mail either. Any suggestions?

Thanks,
Brett

Jan 22 '06 #1
8 1037
Brett,

What language?

IF vb; where are your dim statements and
<%@ Import Namespace="System.Net.Mail" %>

Aaron

"brett" <ac*****@cygen.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I'm getting this error when I try to send mail from my local machine:

The "SendUsing" configuration value is invalid.

Exception Details: System.Runtime.InteropServices.COMException: The
"SendUsing" configuration value is invalid

Here is the code I'm using:

string emailTo = "in**@abc.com";
string emailFrom = "in**@abc.com";
string emailSubject = "Message Inquiry";
string emailBody = "body here";
System.Web.Mail.SmtpMail.Send(emailFrom, emailTo, emailSubject,
emailBody);

When I upload this to the web server, I don't get an error but I don't
get mail either. Any suggestions?

Thanks,
Brett

Jan 22 '06 #2
I thought by the syntax it was implied this is C#. Here are the using
statements:

using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;

What else do you need to see?

Thanks,
Brett

Jan 22 '06 #3
The 2003 method for sending SMTP mail is obsolete, I think the compiler
should give you a warning on that. You should now use the System.Net.Mail
rather then the System.Web.Mail. I can not say if this is the problem, as
the compile is a warning and not an error, but regardless, you should
probably convert you code to use the new namespace and methods.

"brett" wrote:
I thought by the syntax it was implied this is C#. Here are the using
statements:

using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;

What else do you need to see?

Thanks,
Brett

Jan 22 '06 #4
I don't have the Mail in the namespace System.Net.

Brett

Jan 23 '06 #5
Brett

Which version of C# do you have?

Aaron
"brett" <ac*****@cygen.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I don't have the Mail in the namespace System.Net.

Brett

Jan 23 '06 #6
v1.1

Jan 23 '06 #7
Brett,

try this

//------------code starts-------------------
System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = "yo*@test.com";
mail.From = "me@test.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
System.Web.Mail.SmtpMail.SmtpServer = "whatever your smtp server name is";
System.Web.Mail.SmtpMail.Send(mail);
//-----------end code----------------------------

"brett" <ac*****@cygen.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
v1.1

Jan 23 '06 #8
I was originally using that code. It doesn't work either. This
started about 5 days ago. I've made code changes since and not sure
what triggered it. I can't rule out something may be wrong with the
mail server. I've sent my hosting service an email asking but haven't
heard back.

Thanks,
Brett

Jan 23 '06 #9

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

Similar topics

6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
2
by: kmbarz | last post by:
I'm trying to expand my horizons here by working through an ASP.Net book. When I do the example that uses: Line 55: Mail.From = "feedback@graymad.com" Line 56: ...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
10
by: Dennis | last post by:
I am trying to send an e-mail using one of the examples I got on this group as follows: (both toemail and myemail are valid e-mail addreses. 'System.Web.Mail' (requires reference to...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
7
by: Rob Dob | last post by:
The following code is giving me a timeout problem., no matter what I do I can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port 465 and using ssl, if however I try using...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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,...
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.