Here is the code:
Dim sb As New StringBuilder()
sb.Append("The following email was sent to you from WRDCS " & _
"(Warehouse). Please do not reply.")
sb.Append(vbCrLf)
sb.Append(vbCrLf)
sb.Append("Discrepancy in Item: " & Me.txtItem.Text)
sb.Append(vbCrLf)
sb.Append(vbCrLf)
sb.Append("SF: " & vbTab & vbTab & vbTab & Me.txtSF.Text)
sb.Append(vbCrLf)
sb.Append("Reported Weight: " & vbTab & Me.txtNet.Text)
sb.Append(vbCrLf)
sb.Append("Scaled Weight: " & vbTab & vbTab & tmpScaleGrossWeight)
sb.Append(vbCrLf)
Dim mMailMessage As New MailMessage()
Dim client As New SmtpClient(strEmailServer)
mMailMessage.From = New MailAddress("WR***@wrdcs.com")
mMailMessage.To.Add(New MailAddress(strEmailRecipient))
mMailMessage.Subject = "Discrepancy"
mMailMessage.Body = sb.ToString
mMailMessage.IsBodyHtml = False
mMailMessage.Priority = MailPriority.Normal
client.Send(mMailMessage)
mMailMessage.Dispose()
Thanks a lot
"Charlie Brown" wrote:
SMTP will send the mail when your application directs it to. There is
no setting, the defaults will work for the most part. Post your
sending code.