good morning sir,
i read your code and when i apply it shows, i got" your mail not to be send"
sir i am a student and i freely registered in www.kohlihosting.net
sir can u tell me some example to fill it in field below
" SmtpMail.SmtpServer = "your_server_address"; "
sir then i can figure out what i should write here,
i m using linux hosting,
some detail is given below:
VistaPanel version:2.4.0 RC1
Operating systemLinux
Apache version:2.2.12 (Unix)
PHP version:5.2.10
MySQL version:5.0.84
Skin / Graphics Originally developed by CPSkins.com
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Mail;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public int sendMail(string to, string cc, string bcc, string subject, string body)
{
try
{
SmtpMail.SmtpServer = "your_server_address";
MailMessage msg = new MailMessage();
msg.From = "your_email_id";
msg.To = to;
msg.Cc = cc;
msg.Bcc = bcc;
msg.Subject = subject;
msg.Body = body;
SmtpMail.Send(msg);
return (1);
}
catch
{
return (0);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
String to = TextBox1.Text;
String cc = "";
String bcc ="";
String subject = "";
String body = TextBox2.Text;
int status = sendMail(to,cc,bcc,subject,body);
if(status == 1)
Response.Write("your mail has been sent successfully");
else
Response.Write("sorry! your mail could not be sent�");
}
}