INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

"Error initiating communication with Smtp server. (501)

"Error initiating communication with Smtp server. (501)

(OP)
Hello.

I am trying to send email using Microsoft Access 2007 with a special code utility from AXOSOFT.

I get this error message: "Error initiating communication with Smtp server. (501)"

I tested the mail server using Outlook Express and it works fine.

Any ideas what might be the problem that causes this error message?

Next follows a sample of part of the code used:

Thank you in advance.

Stergios.

private static void sendEmail(MailMessage msg, string email)
{

Smtp smtp = new Smtp();

msg.EmailFrom = "myname@myname.gr";

msg.AddEmailTo(email); // pou 8a fugei to email?

msg.EmailMessageType = MessageType.HTML;

msg.EmailSubject = "Personal Schedule for FALL'13";

smtp.SmtpServer = "mail.myname.gr";

smtp.SmtpUser = "myname";

smtp.SmtpPassword = "0000000";

if (!regno.Contains("EX")) { smtp.SendEmail(msg); Thread.Sleep(1000); Console.WriteLine("Sended Number : " + sendCount + " with email : " + email + " and reg:" + regno); }

sendCount++;


}

RE: "Error initiating communication with Smtp server. (501)

Does your smtp server require ssl perhaps?
Here is a snippet I am using send mail via googlemail using .Net.Mail component:

CODE

SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(from, pass);
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; 

Try with enabled ssl.

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: "Error initiating communication with Smtp server. (501)

The OP is not using the .NET SMTPClient. They are using some utility code from AXOSOFT, which does not include the ability to configure using SSL.

The original article for this code is here (and shows the possibly flawed thinking as to why AXOSOFT developed their own SMTP code), and if we read the comments we can see that many people have the 501 problem. It seems to be related to how the code is handling EHLO, and there are at least two suggested modifications to the code suggested in the comments to fix this

e.g. change
WriteBuffer(ns, "ehlo\r\n");
to
WriteBuffer(ns, "helo " + _serverSmtp + "\r\n");

of course the main recommendation might be to stop using AXOSOFT's utility (which frankly isn't actually properly SMTP-compliant), and to indeed use SMTPClient

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close