Click here to Skip to main content
16,020,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Web.Mail;
using System.Net;

MailMessage mail = new MailMessage();
        mail.To = "kishorethoppil@gmail.com";
        mail.Cc = "gisol@rediffmail.com";
        mail.From = "anilapv@gmail.com";
        mail.Subject = "gisol@rediffmail.com";
        mail.Body = "gisol@rediffmail.com";
        mail.BodyFormat = MailFormat.Text;
        SmtpMail.SmtpServer = "server34.hosthat.com";
        SmtpMail.Send(mail);


this is the code i used to send a mail...
SmtpMail.SmtpServer = "server34.hosthat.com"; is my office server


bt it shows an error

The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.

please give me a solution to repair this

Kishore R
Gis Solutions
Posted
Updated 31-Mar-10 3:27am
v2

kishore Rajendran wrote:
he server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.


Your error itself is self explanatory; your SMTP server not allows you send mails outside your domain like gmail or rediffmail. You need to talk to the network team for this.
 
Share this answer
 
You must tell your SmtpClient object your Credentials - there is a Credentials property to do so. NetworkCredential contains user name and password, and optionally domain.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900