Ik heb een database van waaruit ik automatisch een mailtje kan versturen. Ik heb als host/provider: mailhost.hetnet.nl.
Ik o.a.verzend als volgt:
Het programma werkt prima, maar ik wil dus graag dat de gebruiker zijn eigen provider kan invoeren. Ik heb hiervoor een textbestand dat word ingeladen.
Heb dus nu:
textbox4.text wordt ingeladen. in het textbestandje staat: mailhost.hetnet.nl
dus textbox4.text wordt: mailhost.hetnet.nl
de code dus aangepast als volgt:
In textbox4.text verschijnt nu ook keurig: mailhost.hetnet.nl
Echter het zenden mislukt. Wat is hier verkeerd aan met mijn gedachtengang.
Ik o.a.verzend als volgt:
Code:
objemail.To = TextBox2.Text
objemail.Subject = TextBox3.Text
objemail.Textbody = TextBox4.Text
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mailhost.hetnet.nl"
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objemail.Configuration.Fields.Update()
objemail.AddAttachment(TextBox5.Text)
objemail.Send()
If ComboBox1.Text = "hoge prioriteit" Then MSG.Priority = MailPriority.High
If ComboBox1.Text = "normale prioriteit" Then MSG.Priority = MailPriority.Normal
If ComboBox1.Text = "lage prioriteit" Then MSG.Priority = MailPriority.Low
xx = MailPriority.High
Dim SMTP As New SmtpClient()
SMTP.UseDefaultCredentials = True
SMTP.Port = 25
status.Text = "Bericht is verzonden met " + ComboBox1.Text + " op " + Now()
PictureBox1.Image = My.Resources.Good_mark
Het programma werkt prima, maar ik wil dus graag dat de gebruiker zijn eigen provider kan invoeren. Ik heb hiervoor een textbestand dat word ingeladen.
Heb dus nu:
Code:
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mailhost.hetnet.nl"
textbox4.text wordt ingeladen. in het textbestandje staat: mailhost.hetnet.nl
dus textbox4.text wordt: mailhost.hetnet.nl
de code dus aangepast als volgt:
Code:
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
textbox4.text
In textbox4.text verschijnt nu ook keurig: mailhost.hetnet.nl
Echter het zenden mislukt. Wat is hier verkeerd aan met mijn gedachtengang.