Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[16085] 안녕하세요 auth not available(#5.3.3) 오류에 대하여 여쭤볼려고 합니다.
강주환 [] 569 읽음    2020-03-13 12:09
안녕하세요
delphi를 사용한지 얼마 되지않은 초보입니다.
delphi7에서 메일 전송 프로그램을 만들고 있습니다.

구글링하여 소스를 찾아서 진행하였습니다.
메일 전송버튼을 누르면
auth not available(#5.3.3)
오류가 발생하는데 이 부분을 어떻게 해결해야 할 지 답을 찾지 못하여 글을 남깁니다.

소스는 아래와 같습니다.

function TForm1.IdSMTP_Mail(const Server: String; const Port: Integer; const UserField, PasswordField: String;
  FromField, ToField, SubjectField, CompanyField, TextField: WideString; FileNames: TStringList): String;
var
  IdSMTP : TIdSMTP;
  IdMessage : TIdMessage;
  aFileList : TStringList;
  atc : TIdAttachment;

  txtpart : TIdText;
  htmpart : TIdText;
  UTFString : UTF8string;
  i : Integer;
begin
  Result := '';
  IdSMTP := TIdSMTP.Create(nil);
  IdSMTP.AuthenticationType := atLogin; // 로그인 방식
  IdSMTP.Host := Server;
  IdSMTP.Port := Port;
//  IdSMTP.UseEhlo := True;
  IdSMTP.Username := UserField;
  IdSMTP.Password := PasswordField;

  IdMessage := TIdMessage.Create(nil);

  IdMessage.CharSet := 'euc-kr';
  IdMessage.Headers.Text := 'Content-type:text/html';
  IdMessage.ContentType := 'Text/html';

  IdMessage.From.Address := FromField; // 보내는 사람
  IdMessage.Recipients.EMailAddresses := ToField; // 받는 사람
  IdMessage.Subject := SubjectField; // 제목
  IdMessage.Body.Add(TextField);

  if FileNames <> nil then begin
    if FileNames.Count > 0 then begin
      for i := 0 to FileNames.Count -1 do begin
        TIdAttachment.Create(IdMessage.MessageParts, Trim(FileNames.Strings[i]));
      end;
      txtpart := TIdText.Create(IdMessage.MessageParts);
      txtpart.ContentType := 'text/plain';
      htmpart := TIdText.Create(IdMessage.MessageParts);
      // Attachments Case By Mime Type -> chartset - UTF-8 인코딩해서 보낸다 (변환필수) 핵심
      UTFString := UTF8Encode(WideString(TextField)); // delphi7 version 함수
      htmpart.Body.Add(UTFString);
      htmpart.ContentType := 'text/html';
    end;
  end;

//  htmpart := TIdText.Create(IdMessage.MessageParts);

  Try
    IdSMTP.Connect;
    IdSMTP.Send(IdMessage); <-- 이 부분에서 오류 발생
  Except on E : Exception do begin
    Result := '메일 전송 중 오류 발생' + #13 + E.Message;
    ShowMessage(Result);
  end; end;
{
  if FileNames.Count > 0 then begin
    txtpart.Free;
    htmpart.Free;
  end;
}
  IdSMTP.Disconnect;
  IdSMTP.Free;
  IdMessage.Free;
  IdSMTP := Nil;
  IdMessage := Nil;
end;

+ -

관련 글 리스트
16085 안녕하세요 auth not available(#5.3.3) 오류에 대하여 여쭤볼려고 합니다. 강주환 569 2020/03/13
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.