views:

276

answers:

3

Hi Experts,

I am using asp.net and C#.

I have deployed my application on the server and now I come to know that my server would not provide me SMTP detail , is their any way I could send sms without smtp details.

I can use bot asp.net3.5 with C# or SQL Server 2005 to send mail.

Thanks in advance

A: 

It is easy to send through SQL Server: http://msdn.microsoft.com/en-us/library/aa260697%28SQL.80%29.aspx If your administrators will allow it. It is debatable whether this is good practice, but I worked at one place that perfromed all of its automated emailing of error notifications for example, using xp_sendmail

Daniel Dyson
Can I use any webservice to send mail ??
Zerotoinfinite
A: 

Yes, your server absolutely has an IP address, you just don't know what it is. Here is some information on finding out what your IP address is..

No, you cannot send or receive any kind of email without the proper server/connection information. Otherwise, I could just send email from your account without you knowing it.

Robert Greiner
My mistake ! I corrected it to SMTP. Please let me know how to send the mail, can I use any web service ?
Zerotoinfinite
A: 

To send an email with C# / .NET, make use of the System.Net.MailMessage and System.Net.SmtpClient classes.

Create a new instance of the MailMessage class, set some properties (from, to, body, subject, etc).

Create a new instance of the SmtpClient class, set some properties (SMTP credentials).

Then just do smtpClient.Send(mailMessage).

Pretty simple.

RPM1984
As I said earlier I don't have SMTP details, will the above code work without SMTP details ?
Zerotoinfinite
Sorry - i thought the below comment implied you had the details.Without SMTP details, your only option in SQL Server Mail.
RPM1984