tsdiouafae
Messages postés3Date d'inscriptionlundi 23 octobre 2006StatutMembreDernière intervention 7 juin 2008
-
6 juin 2008 à 10:25
tsdiouafae
Messages postés3Date d'inscriptionlundi 23 octobre 2006StatutMembreDernière intervention 7 juin 2008
-
6 juin 2008 à 16:54
Bonjour à tous
Actuellement je réalise une petite application en VB.net dans laquelle j'utilise le contrôle system.net.mail pour l'envoi d e-mail.
Néaj'ai travaille avec le serveur smtp mais le serveur smtp demande une authentification,
mon mail ne sera pas envoyé
question:
comment envoyer au serveur smtp le login et le mot de passe pour l'authentification et quelle syntaxe utiliser ?
tsdiouafae
Messages postés3Date d'inscriptionlundi 23 octobre 2006StatutMembreDernière intervention 7 juin 2008 6 juin 2008 à 16:54
merci bcp mé j'ai pas trouve ce que je veux c mon code
Try
Dim
Counter
As
Integer
If
txtSMTPServer.Text =
""
Then
MsgBox(
"Enter the SMTP server info ...!!!"
, MsgBoxStyle.Information,
"Send Email"
)
Exit
Sub
End
If
If
txtFrom.Text =
""
Then
MsgBox(
"Enter the From email address ...!!!"
, MsgBoxStyle.Information,
"Send Email"
)
Exit
Sub
End
If
If
txtTo.Text =
""
Then
MsgBox(
"Enter the Recipient email address ...!!!"
, MsgBoxStyle.Information,
"Send Email"
)
Exit
Sub
End
If
If
txtSubject.Text =
""
Then
MsgBox(
"Enter the Email subject ...!!!"
, MsgBoxStyle.Information,
"Send Email"
)
Exit
Sub
End
If
obj =
New
SmtpClient(txtSMTPServer.Text)
Mailmsg.To.Add(
New
MailAddress(txtTo.Text))Mailmsg.From =
New
MailAddress(txtFrom.Text)
If
chkFormat.Checked =
True
Then
Mailmsg.IsBodyHtml =
True
PrintLine(1, ConvertToHTML(RichTextBox1))
Else
Mailmsg.IsBodyHtml =
False
End
If
Mailmsg.Subject = txtSubject.Text
For
Counter = 0
To
lstAttachment.Items.Count - 1Attachment =
New
Attachment(lstAttachment.Items(Counter))Mailmsg.Attachments.Add(Attachment)
Next
Mailmsg.Body = RichTextBox1.Text
AddHandler
obj.SendCompleted,
AddressOf
Client_SendCompleted
obj.EnableSsl =
True
obj.SendAsync(Mailmsg,
Nothing
)
Catch
ex2
As
SmtpFailedRecipientException
MessageBox.Show(ex2.Message)
obj.EnableSsl =
True
'obj.SendAsync(Mailmsg, Nothing)
obj.Send(Mailmsg)
Catch
ex
As
SmtpExceptionMessageBox.Show(ex.Message)
End
Try
me donne un message d'erreur et ce que j'ai compri j'ai un erreur au niveau de serveur smtp il me donne un message " le serveur smtp requirt n connxion securise ou le client n'etait pas authentifie "