procedure Tfrmemail.Un_MailSend; var AMsg : TidMessage; AddressItem : TidEmailAddressItem; begin idSMTP1.host := 'smtp.gmail.com'; idSMTP1.Username := 'lskgood0@gmail.com'; idSMTP1.password := '123'; idSMTP1.Port := 465; AMsg := TidMessage.Create(Self); AMsg.Clear; AMsg.ContentType := 'text/html'; AMsg.Subject := '[미드미 키보드] 고객님께서 주문하신 미드미 키보드 등록 메일 입니다.'; AddressItem := AMsg.BccList.Add; AddressItem.Address := 'midmee@midmee.com'; <-수신확인? AddressItem.Name := '이정욱'; AMsg.From.Address := 'midmee@midmee.com'; <- 보내는사람? AMsg.From.Name := '미드미 키보드'; AddressItem := AMsg.Recipients.Add; AddressItem.Address := EMailEdit.Text; <-받는 사람? AddressItem.Name := eRegName.Text; AMsg.Body.LoadFromFile(ExtractFilePath(Application.ExeName)+'\RegMail.txt'); AMsg.Date := NOW; idSMTP.Disconnect; idSMTP.Connect; idSMTP.Send(AMsg); AMsg.Free; end;
멜보면~ 자꾸 gmail 로 편지가 날라오네요 ㅠ.ㅠ;
아래의 파일은 첨부파일을 어떻게 다루는지 나온 소스 입니다.
procedure TMailerForm.btnSendMailClick(Sender: TObject) ; begin StatusMemo.Clear; //setup SMTP SMTP.Host := ledHost.Text; SMTP.Port := 25; //setup mail message MailMessage.From.Address := ledFrom.Text; MailMessage.Recipients.EMailAddresses := ledTo.Text + ',' + ledCC.Text; MailMessage.Subject := ledSubject.Text; MailMessage.Body.Text := Body.Text; if FileExists(ledAttachment.Text) then TIdAttachment.Create(MailMessage.MessageParts, ledAttachment.Text) ; //send mail try try SMTP.Connect(1000) ; SMTP.Send(MailMessage) ; except on E:Exception do StatusMemo.Lines.Insert(0, 'ERROR: ' + E.Message) ; end; finally if SMTP.Connected then SMTP.Disconnect; end; end;
if FileExists(FileListBox1.Items.strings[0]) then TIdAttachmentFile.Create(AMsg.MessageParts, FileListBox1.Items.strings[0]) ;
This is a multi-part message in MIME format --L1lHvf=_pGTd76kAwZ1qFGxVlPcpwrcXpr Content-Type: text/plain Content-Transfer-Encoding: 8bit E-Mail : lskgood@lycos.co.kr 발신처 : 이승규 연락처 : 031-371-0134 --L1lHvf=_pGTd76kAwZ1qFGxVlPcpwrcXpr Content-Type: application/octet-stream; name="110-20101213017_1083.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="110-20101213017_1083.jpg" /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsK CwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAIzAxoDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9U6KK
이렇게 멜이 왔네요 ㅋㅋ
ㅎㅎ 소스를 보고 코딩해서~ 보내봐도~ 역시나
This is a multi-part message in MIME format --L1lHvf=_pGTd76kAwZ1qFGxVlPcpwrcXpr Content-Type: text/plain Content-Transfer-Encoding: 8bit E-Mail : lskgood@lycos.co.kr 발신처 : 이승규 연락처 : 031-371-0134 --L1lHvf=_pGTd76kAwZ1qFGxVlPcpwrcXpr Content-Type: application/octet-stream; name="110-20101213017_1083.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="110-20101213017_1083.jpg" /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsK CwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAIzAxoDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9U6KK
나오네요~~
왜 이러는지 휴~ 정말 알수가 없네요 ㅋㅋㅋ 이미지를 보내서 그러는것 같지는 않은뎅
무슨 버그가 있나 쉽네요 ㅠ.ㅠ;
종 가르쳐주세요 우엉~~
파일 두개 이상일경우 파일 하나 와 하나 사이에 구분자를 줘야 하는지 ㅠ.ㅠ;
정말 답답합니당 ㅠ.ㅠ;
감사합니당 ^^
혹시 메일 View(다음메일...)가 혹시 아웃룩인가요 ??? (죄송 궁금해서요)