Image ou Form dans mon mail

inraf Messages postés 104 Date d'inscription samedi 5 juillet 2008 Statut Membre Dernière intervention 15 novembre 2012 - 15 nov. 2012 à 14:16
 Utilisateur anonyme - 15 nov. 2012 à 18:31
Bonjour,
Je souhaite envoyer un mail avec comme corps mon Form ou l'image d'un picturebox pour envoyer le mail pas de problème, mais pour mettre une image dans le mail ou mieux mon Form ???

Pour info voici la méti-ode pour envoyer le mail.

Try


Dim MySMTPClient As New SmtpClient("Smtpclient")
MyMail.From = New MailAddress("blabla@truc.be")
MyMail.To.Add(New MailAddress(TextBox3.Text))
'MyMail.To.Add(New MailAddress("blabla@truc.be"))
MyMail.CC.Add(New MailAddress("blabla@truc.be"))
MyMail.Body = ici je souhaite ajouter mon Form ou une image
MyMail.Priority = MailPriority.Normal
MyMail.Subject = "Commande Gourmand"

'For Each Lines As String In "Commande N°" + Label10.Text + " Date : " + Label11.Text + Environment.NewLine + RichTextBox1.Text
'imprimer le doc
print_Form()
' Next
MySMTPClient.Send(MyMail)
MsgBox("E-Mail bien envoyé !", MsgBoxStyle.Information, "Envoi de l'E-Mail")
MyMail.To.Clear()
MyMail.Attachments.Clear()


Catch ex As Exception
MsgBox("Impossible d'envoyer l'E-Mail.", MsgBoxStyle.Critical, "Envoi de l'E-Mail")
MyMail.To.Clear()
MyMail.Attachments.Clear()

End Try

1 réponse

Utilisateur anonyme
15 nov. 2012 à 18:31
Bonjour,

Tiré de l'aide de VB


Dim pf As New PrintForm
pf.Form = Me
pf.PrintAction = PrintToPrinter
pf.Print()


Dans la rubrique

PrintForm, classe

Avec la quantité de programmes gratuits qui "impriment" des fichiers PDF, tu t'arranges pour avoir une "imprimante" PDF et tu envoies ton PDF en pièce jointe.
0
Rejoignez-nous