Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am running XP with an exchange server. I am trying to create an app that has email functionality. My problem is that I can send all the email I want within my domain but anything that I try to send outside the domain never gets sent.

 

I dont get any error or faults. The mail just never shows up. Can anyone help me with this please? Thanks

 

Here is my code

Dim eml As New System.Web.Mail.MailMessage()

System.Web.Mail.SmtpMail.SmtpServer = lblsmtp.Text

 

With eml

.To = txtemailaddress.text

.Subject = txtSubject.Text

.Cc = lblFrom.Text

.Body = txtMessage.Text

.From = lblFrom.Text

Select Case cboPriority.Text

Case "Low"

.Priority = MailPriority.Low

Case "Normal"

.Priority = MailPriority.Normal

Case "High"

.Priority = MailPriority.High

End Select

.BodyFormat = MailFormat.Text

End With

 

If MessageBox.Show("Send email?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then

Try

System.Web.Mail.SmtpMail.Send(eml)

MessageBox.Show("The email has been successfully sent.", "Email", MessageBoxButtons.OK, MessageBoxIcon.Information)

Me.Close()

Catch ex As Exception

MessageBox.Show("The following error occured while sending email:" & vbCrLf & ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

End If

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...