Click to See Complete Forum and Search --> : SMTP Related Error


harshadashende
September 29th, 2011, 02:03 AM
Hello,
I had written a programme in VC++ for sending the mails using SMTP.
It sends the mails to and from the particular domain only.
I want to send the mail using Rediffmail or Gmail . But its not possible.

Foll. are the settings for sending the mail from Rediffmail :
SmtpServerName = smtp.rediffmail.com
SmtpServerPort = 25

If i run the prog. it gives the foll. error for :
<Code>
CString sTo;
sTo.Format( _T( "RCPT TO: <%s>\r\n" ), "xxxxx@gmail.com");
m_wsSMTPServer.Send( (LPCTSTR)sTo, sTo.GetLength() );
</Code>

m_wsSMTPServer is a object of CSocket.

The Error is :

421 Authorization failed: please authenticate by doing get message first

So for this error I had added Authentication by using following :
<Code>
//////Check for authentication
sLogIn.Format( _T( "AUTH LOGIN: <%s><%s>\r\n" ), "abc@rediffmail.com", "12Xy3z");
m_wsSMTPServer.Send( (LPCTSTR)sLogIn, sLogIn.GetLength() );
</Code>

here it give the foll. error :

502 unimplemented (#5.5.1).

I really stuck here .I searched a lot, but not succeeded. Any kind of help is much appreciated.

Thanking you in anticipation.

--Harshada

JapyDooge
September 29th, 2011, 05:29 AM
Why are you doubleposting?

http://www.codeguru.com/forum/showthread.php?t=516800

harshadashende
September 29th, 2011, 06:08 AM
I wanted to and even tried to remove this thread from here (General Discussion / Chit Chat ). But could not succeeded.

--Harshada

JapyDooge
September 29th, 2011, 07:00 AM
You might want to try these commands:

http://en.wikipedia.org/wiki/SMTP_Authentication#Details

harshadashende
September 29th, 2011, 07:21 AM
Thanks a lot for your reply. I tried all that but couldn't find anything. I even tried to run telnet with the foll commands
command = open smtp.rediffmail.com 25
Result = 220 webmail138.rediffmail.com ESMTP

command = EHLO smtp.rediffmail.com
Result = 250-webmail38.rediffmail.com
250-PIPELINING
250 8BITMIME

It doesn't given me any information related to STARTTLS.

command = MAIL FROM xxxx@rediffmail.com
Result = 250 OK

command = RCPT TO xxxx@yyy.com
result = 421 Authorization Failed. Pls. authenticate by doing get message first.

Now if I give command for AUTH LOGIN


command = AUTH LOGIN xxxxx@rediffmail.com xyz!2Three

result = 502 unimplemented <#5.1.1>

the parameters for AUTH LOGIN are encoded to base64

--Thanking you in anticipation.

--harshada