smtp error NO 503

MRQMRQ Member Posts: 73
hi

i am trying to send email using the SMTP

this is the Code

SmtpMail.NewMessage('shafe@laru.com','Subject of the mail');
SmtpMail.SetWorkMode();
SmtpMail.SetHost('mail.laru.com');
SmtpMail.SetUserID('shafe@laru.com');
SmtpMail.AddLine('This is a test.');
SmtpMail.AddLine('The second line.');
SmtpMail.AddLine('Third line');
SmtpMail.AddAttachment('c:\test.txt');
SmtpMail.SetToAdress('test@gmail.com');
SmtpMail.Send;
IF NOT SmtpMail.WasSuccessful THEN
MESSAGE(SmtpMail.LastError);

but this error come out
503 bad sequence of commands
what is the meaning of this how can i fix this problem

Comments

  • MRQMRQ Member Posts: 73
    do i need to do any thing in IIS to solve this problem

    any one ](*,)
  • AlbertvhAlbertvh Member Posts: 516
    Hi MRQ

    I'm assuming that you are using the download for the SMTP Mail.

    I use the following code
    Documentation()
    
    OnRun()
    
    SendMail(ToName : Text[250];FromName : Text[250];Subject : Text[250];Attachment : Text[250]) : Boolean
    CompInfo.GET;
    Mail.SetHost(CompInfo."SMTP Address");
    Mail.SetToAdress(ToName);
    Mail.SetFromAdress(FromName);
    Mail.SetSubject(Subject);
    IF Attachment <> '' THEN
      Mail.AddAttachment(Attachment);
    Mail.Send;
    Ok := Mail.WasSuccessful;
    EXIT(Ok);
    
    AddLine(Body : Text[1024])
    IF Body = '' THEN
      EXIT;
    
    Mail.AddLine(Body);
    
    

    Where the followinf are
    Name DataType Subtype Length
    CompInfo Record Company Information
    Mail OCX SmtpMailX Element
    i Integer
    Ok Boolean

    You will also have to register you OCX Tools->Custom Controls Browse and find the SMTP.ocx.

    Perhaps this helps. :-k

    Albert
Sign In or Register to comment.