mustafa kartal Posted June 11, 2018 Share Posted June 11, 2018 Merhaba Grid pdf aktarmak ve o pdf email atmak istiyorum bunu nasıl yaparım bu konuda bana yardımcı olurmusunuz hali hazırda email atabiliyorum fakat dosya eklem işlemi desteklemiyor Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 11, 2018 Administrators Share Posted June 11, 2018 Mail atmak için INDY komponentlerini kullanıyorsanız Attachment eklemeniz mümkündür. Link to comment Share on other sites More sharing options...
mustafa kartal Posted June 11, 2018 Author Share Posted June 11, 2018 ney yazıkki göndermiyor hata veriyor This is a multi-part message in MIME format --waTjuJrJjLlIlETuor=_N5LXkaXcdoFomj Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline --waTjuJrJjLlIlETuor=_N5LXkaXcdoFomj Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name="test.xlsx" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.xlsx" --waTjuJrJjLlIlETuor=_N5LXkaXcdoFomj-- Link to comment Share on other sites More sharing options...
mustafa kartal Posted June 11, 2018 Author Share Posted June 11, 2018 Hata email içeriği bozuk geliyor This is a multi-part message in MIME format --5SPhpW3kSzdR8p=_Pv5qSFRuBe2P0GPGOZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MTN GRUP A.=C5=9E DESTEK H=C4=B0ZMET=C4=B0 = F=C4=B0RMA ADI : ERKAPLAN CARPET TEKST=C4=B0L <= /td> TALEB=C4=B0N GELD=C4=B0=C4=9E=C4=B0 YER= : Telefon SORUN BA=C5=9ELIK : = PDKS C=C4=B0H= AZI A=C4=9EDA OKUNMUYOR TALEP TAR=C4=B0= H=C4=B0 : 08.06.2018 SORUN : PDKS Y=C3=9CZ OKUMA C=C4= =B0HAZI NETWORK G=C4=B0R=C4=B0=C5=9E I=C5=9EI=C4=9EI YANMIYOR VER=C4=B0LEN H=C4=B0ZMETLER : PDKS C=C4=B0HAZ ARIZASI VER=C4=B0LEN MALZEMELER : =C3=87=C3=96Z=C3=9CM TAR=C4=B0H=C4=B0 : 08.0= 6.2018 S=C3=9C= RE : 02:15:00 <= /td> =C3=87=C3=96Z=C3=9CM : PDKS C=C4=B0HAZI NETWORK G=C4=B0R=C4=B0=C5=9E=C4=B0 ARIZALI OLDUG= U TESP=C4=B0T ED=C4=B0LM=C4=B0=C5=9ET=C4=B0R. ESK=C4=B0 ARIZALI OLAN P= DKS C=C4=B0HAZIDA ALINARAK ARIZALI OLAN KART ESK=C4=B0 C=C4=B0HAZDAN A= LINIP YEN=C4=B0 C=C4=B0HAZA TAKILARAK SORUN G=C4=B0DER=C4=B0LM=C4=B0=C5= =9ET=C4=B0R SONU=C3=87 : =C3=87= =C3=B6z=C3=BCld=C3=BC = --5SPhpW3kSzdR8p=_Pv5qSFRuBe2P0GPGOZ Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name="test.xlsx" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.xlsx" --5SPhpW3kSzdR8p=_Pv5qSFRuBe2P0GPGOZ-- Link to comment Share on other sites More sharing options...
mustafa kartal Posted June 11, 2018 Author Share Posted June 11, 2018 normal de bu şekilde gelmesi gerekli Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 11, 2018 Administrators Share Posted June 11, 2018 Indy ile ilgili dokümanlara veya örneklere bakmanızı öneriyorum. Link to comment Share on other sites More sharing options...
mustafa kartal Posted June 11, 2018 Author Share Posted June 11, 2018 normal windows email gönderirken dosya ekleyebiliyorum vede gönderebiliyorum bir sorun yok unigui den gönderirken böyle oluyor Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 11, 2018 Administrators Share Posted June 11, 2018 Göndermek için kullandığınız kodları paylaşır mısınız? Indy kullanıp kullanmadığınızı sormuştum. Link to comment Share on other sites More sharing options...
mustafa kartal Posted July 26, 2018 Author Share Posted July 26, 2018 var ek_dosya:string; begin statusmemo.Visible:=True; if edt_kime.Text='' then begin MainForm.Mesaj_var('Email Adresi Giriniz','Uyarı'); edt_kime.setfocus; exit; end; if edt_konu.Text='' then begin MainForm.Mesaj_var('Mesaj konusu bulunamadı.','Uyarı'); edt_konu.setfocus; exit; end; if edt_html.Text='' then begin MainForm.Mesaj_var('Mesaj bulunamadı.','Uyarı'); edt_html.setfocus; exit; end; if Dm.SSL=True then begin SSL_Email_Gonder; end else begin SMTP.Host :=Gidposta; SMTP.Port :=StrToInt(port); SMTP.Username:=email; SMTP.Password :=parola; MailMessage.ContentType:='text/html; charset=UTF-8'; MailMessage.ContentTransferEncoding:='iso-8859-9'; MailMessage.From.Address :=email; MailMessage.Recipients.EMailAddresses :=MailMessage.Recipients.EMailAddresses+ (edt_kime.Text); MailMessage.Subject :=edt_konu.Text; MailMessage.Body.Text :=edt_html.Text; MailMessage.CCList.EMailAddresses:=MailMessage.CCList.EMailAddresses+edt_cc.Text; MailMessage.AttachmentEncoding:='MIME'; TIdAttachmentFile.Create(MailMessage.MessageParts, UniServerModule.FilesFolderPath+'\img\test.xlsx'); MailMessage.Encoding:=meMIME; try try SMTP.Connect; SMTP.Send(MailMessage); except on E:Exception do end; finally if SMTP.Connected then SMTP.Disconnect; end; MainForm.Mesaj_var('Email gönderildi','Bilgi'); end; Close; Frm_Hızmet_ver.Close; Link to comment Share on other sites More sharing options...
mustafa kartal Posted July 26, 2018 Author Share Posted July 26, 2018 Aşagıdaki kodu iptal edersem dosya gönderiliyor fakat email içindeki tüm html ve mesajlar saçma sapan bir şey oluyor. kodu tekrar eklersem yukardaki gibi bozuk vede dosyayı eklemiyor MailMessage.ContentType:='text/html; charset=UTF-8'; MailMessage.ContentTransferEncoding:='iso-8859-9'; Yani Dosya gönderiyorum mesaj içirği bozuluyor dosyayı göndermiyorum mesaj doğru gidiyor fakat dosya olmuyor Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 26, 2018 Administrators Share Posted July 26, 2018 Bir de bu şekilde deneyin : MailMessage.ContentType:='text/html' MailMessage.CharSet := 'utf-8'; Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 26, 2018 Administrators Share Posted July 26, 2018 Buraya da bakabilirsiniz: https://stackoverflow.com/questions/45294836/sending-e-mail-with-attachments-with-indy Link to comment Share on other sites More sharing options...
mustafa kartal Posted July 27, 2018 Author Share Posted July 27, 2018 Farshad bey teşekkürler vermiş olduğunuz linktdeki kodu kullanarak hem dosya gönderildi hemde httml olarak epostam ulaştı Link to comment Share on other sites More sharing options...
mustafa kartal Posted July 27, 2018 Author Share Posted July 27, 2018 Kullanmış olduğum kod belki başkasına yarabilir procedure TFrm_Email_Gonder.SendEmailIndy( const SMTPServer: string; const FromName, FromAddress: string; const ToAddresses: string; //comma separated list of e-mail addresses const CCAddresses: string; //comma separated list of e-mail addresses const BCCAddresses: string; //comma separated list of e-mail addresses const Subject: string; const EmailBody: string; const IsBodyHtml: Boolean); var smtp: TIdSMTP; // IdSmtp.pas msg: TidMessage; // IdMessage.pas builder: TIdMessageBuilderHtml; //IdMessageBuilder.pas begin msg := TidMessage.Create(nil); try builder := TIdMessageBuilderHtml.Create; try if IsBodyHtml then begin builder.Html.Text := EmailBody; builder.HtmlCharSet := 'utf-8'; builder.HtmlContentTransfer := 'quoted-printable'; end else begin builder.PlainText.Text := EmailBody; builder.PlainTextCharSet := 'utf-8'; builder.PlainTextContentTransfer := 'quoted-printable'; end; builder.Attachments.Add(UniServerModule.FilesFolderPath+'\img\test.xlsx'); builder.FillMessage(msg); finally builder.Free; end; msg.From.Name := FromName; msg.From.Address := FromAddress; msg.Subject := Subject; msg.Recipients.EmailAddresses := ToAddresses; msg.CCList.EmailAddresses := CCAddresses; msg.BccList.EmailAddresses := BCCAddresses; smtp := TIdSMTP.Create(nil); try smtp.Host := SMTPServer; // IP Address of SMTP server Smtp.UseTLS := utNoTLSSupport; smtp.Port := 587; //The default already is port 25 (the SMTP port) smtp.Username := 'test@test.com'; smtp.Password := '12345'; smtp.AuthType := satDefault; smtp.Connect; try smtp.Send(msg); finally smtp.Disconnect; end; finally smtp.Free; end; finally msg.Free; end; ShowMessage('gitti'); Link to comment Share on other sites More sharing options...
mustafa kartal Posted July 27, 2018 Author Share Posted July 27, 2018 Bir diğer konu ise fastreport çıkıtı olarak göstermiş olduğum raporu mail olarak göndermek istiyorum fastreport da çıktı alabiliyoruz bu çıktıyı runtime ram üzerinde veya programın çalıştıgı dizinde herhangi bir yere kayıt ederek ve o kayıt edilen dosyayı mail olarak göndermek istiyorum fastreport da göstermiş olduğum raporu kullanıcıya göstermeden exe dizin kayıt ettirkmek istiyorum bunu unigui ile yapmamız mümkünmü acaba veya herhangi bir bileşen mi kullanmamız gerekli Link to comment Share on other sites More sharing options...
Freeman35 Posted July 27, 2018 Share Posted July 27, 2018 fastreport içinde "Export" yordamını kullanacaksınız. tanılmıyorsam demolarda vardı. "FileName" ilede path dahil export edilecek yol ve dosya adını verebilirsiniz. Link to comment Share on other sites More sharing options...
mustafa kartal Posted July 27, 2018 Author Share Posted July 27, 2018 Yok ne yazıkki o yöntem işe yaramıyor Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now