Hello,
Let me first say that I searched the forums for a solution, but no matter what I try it's always the same. No error, no e-mail.
Below is a sub I use to send e-mail. It executes without any errors, but I never get the e-mail.
Is there something I'm missing here?
Let me first say that I searched the forums for a solution, but no matter what I try it's always the same. No error, no e-mail.
Below is a sub I use to send e-mail. It executes without any errors, but I never get the e-mail.
Is there something I'm missing here?
vb.net Code:
Private Sub labelaKliknuta(ByVal sender As DevExpress.XtraEditors.HyperLinkEdit, ByVal e As System.EventArgs) If sender.Tag <> "" Then If MessageBox.Show("Da li ste sigurni da elite poslati rođendansku čestitku studentu: " & vbNewLine & sender.Text & "", "Potvrda", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then Dim MyMailMessage As New MailMessage() Try MyMailMessage.From = New MailAddress("someaddress@something") MyMailMessage.To.Add(sender.Tag.ToString) MyMailMessage.Subject = "Sretan rođendan!" MyMailMessage.Body = "Potovani kolega " & sender.Text & "," & vbNewLine & "elimo Vam mnogo sreće i veselja za Va rođendan!" & vbNewLine & "Va, Team." Dim SMTP As New SmtpClient("smtp.googlemail.com") SMTP.EnableSsl = True SMTP.Port = 465 SMTP.Credentials = New System.Net.NetworkCredential("username", "password") SMTP.SendAsync(MyMailMessage, Nothing) MessageBox.Show("Poslano") Catch ex As Exception MessageBox.Show("Greska") End Try End If Else MessageBox.Show("Za odabranog studenta ne postoji podatak o e-mail adresi u sistemu" & vbNewLine & "Molimo kontaktirajte administratora kako bi se problem rijeio", "Nedostaje e-mail adresa", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) End If End Sub