| | |
error sending mail using system.net.mail
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 144
Reputation:
Solved Threads: 0
hi I'm trying to use this code that i found to send an email message using c# application.
i have an iis service running on my computer and the smtp server is configured as my providers smtp server.
the problem is that when i try to send mail i get an error message:
"the specified string is not in the form required for an e-mail address"
i swear to god that i insert a valid mail address.
my code is:
help please.
i have an iis service running on my computer and the smtp server is configured as my providers smtp server.
the problem is that when i try to send mail i get an error message:
"the specified string is not in the form required for an e-mail address"
i swear to god that i insert a valid mail address.
my code is:
c# Syntax (Toggle Plain Text)
MailMessage message = new MailMessage(to, from, subject, mess); SmtpClient client = new SmtpClient("mail.bezeqint.net"); client.UseDefaultCredentials = true; client.Send(message); return "Message sent to " + to + " at " + DateTime.Now.ToString() + ".";
help please.
•
•
Join Date: Nov 2007
Posts: 144
Reputation:
Solved Threads: 0
the mails are not local.
i guess i tried many options and i dont know which one one is right.
i tried to configure the iis smtp server to my isp and i entered my password, when i tried to send it showed an error that access was denied.
i tried to reset all settings and defined the relay on 127.0.0.1 (local host). nothing seems to work.
is there any way to send emails with the iis default smtp server ?
i guess i tried many options and i dont know which one one is right.
i tried to configure the iis smtp server to my isp and i entered my password, when i tried to send it showed an error that access was denied.
i tried to reset all settings and defined the relay on 127.0.0.1 (local host). nothing seems to work.
is there any way to send emails with the iis default smtp server ?
Look I've experience about that, I never ever use SMTP to send emails because I am sure the destination would be the JUNK! I use CDO (Microsoft CDO for Windows 2000 library) instead.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Nov 2007
Posts: 144
Reputation:
Solved Threads: 0
ok i looked for Microsoft CDO for Windows 2000 library and i found some code that should do the job:
is there any other configuration i should do ?
cause i ran the code (doesn't seem to do anything).
c# Syntax (Toggle Plain Text)
CDO.Message oMsg = new CDO.Message(); CDO.IConfiguration iConfg; iConfg = oMsg.Configuration; ADODB.Fields oFields; oFields = iConfg.Fields; // Set configuration. ADODB.Field oField = oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"] oField = oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"]; oField.Value = 1; oMsg.Subject = "Test"; oMsg.From = from; oMsg.To = to; oMsg.Send();
is there any other configuration i should do ?
cause i ran the code (doesn't seem to do anything).
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
•
•
•
•
the mails are not local.
i guess i tried many options and i dont know which one one is right.
i tried to configure the iis smtp server to my isp and i entered my password, when i tried to send it showed an error that access was denied.
i tried to reset all settings and defined the relay on 127.0.0.1 (local host). nothing seems to work.
is there any way to send emails with the iis default smtp server ?
Which is normal. Most servers these days are configured that way to reduce spam.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
No way man ... you can do this
or
works like a bombbbbbbb
c# Syntax (Toggle Plain Text)
mail.Priority = MailPriority.High;
or
c# Syntax (Toggle Plain Text)
mail.Priority = MailPriority.Normal;
works like a bombbbbbbb
Delphi & C# programmer deluxe...
![]() |
Similar Threads
- Sending mails in vb.net 1.0 (VB.NET)
- Main sending in Asp.net (ASP.NET)
- asp.net 2005 sending email (C#)
- Sending Email (JSP)
- Asp.net code for sending email (Visual Basic 4 / 5 / 6)
- sending email (JSP)
- Need help sending email (ASP.NET)
- sending email (ASP.NET)
- Email Sending Problem in ASP.NET (ASP.NET)
- email mail deliver error?? virus? (Windows NT / 2000 / XP)
Other Threads in the C# Forum
- Previous Thread: Automatially move data
- Next Thread: Scrollbars in windows application
| Thread Tools | Search this Thread |
.net access activedirectory ado.net algorithm array barchart basic bitmap box broadcast buttons c# check checkbox client color combobox contorl control conversion csharp custom database datagrid datagridview dataset datetime degrees deployment development draganddrop drawing editing editor encryption enum event excel file form format forms function gdi+ httpwebrequest i18n image imageprocessing index input install java label list listbox mandelbrot math mathematics mouseclick mysql operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox rows serialization server sleep socket sql statistics stream string table text textbox thread time timer update user usercontrol validation visualstudio webbrowser windows winforms wpf xml






