Hello!
Thro' the above code i have a mail saved in my inetpub\mailroot\queue folder as an internet mail message......
As u said when i declare the smtpserver as follows after mailmsg.bodyformat:
SmtpMail.SmtpServer="localhost";
try
{
SmtpMail.Send(msg);
Response.Redirect("welcome.aspx");
}
catch(Exception exc)
{
Response.Write("Sorry ur mail could not be sent:"+exc.ToString());
}
Now it gives me following error:
"Sorry ur mail could not be sent:System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020F): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for rhyme2ri2@gmail.com --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) at System.Web.Mail.LateBoundAccessHelper.CallMethod(T ype type, Object obj, String methodName, Object[] args) at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at StateManagement.WebForm1.cmdregister_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\statemanagement\login.aspx.cs:l ine 81 "
Sorry i know it's quite long but i don't get anything from that.....
I wud also like to know if i'll be able to send mails from localhost??