vbSendMail does not send email
-
Hello! I've an application that uses vbSendMail.dll for emails. When in debug mode the application works smoothly. However once I've compiled/packaged the app using VS package and deployment wizard it does not send emails. Weird thing is it does not generate any error. vbSendMail.dll and mswinsck.ocx both have been included in the package and registered successfully. By the way I'm using vb6 for this app. This is the part of the email code
Set vbemail = New vbSendMail.clsSendMail
vbemail.SMTPHost = "****.*****.***"
vbemail.FromDisplayName = ""
sendemail
...................
vbemail.From = senderemail
vbemail.CcRecipient = "*********"
For i = 1 To Adodc3.Recordset.RecordCount
vbemail.Recipient = vbemail.Recipient + Adodc3.Recordset!email + ";"
Adodc3.Recordset.MoveNext
Next iIf Not txtemail.Text = "" Then vbemail.CcRecipient = vbemail.CcRecipient + ";" + txtemail.Text End If vbemail.Attachment = Adodc1.Recordset!screenshot vbemail.Subject = "\[INCIDENT\] WSA " & Adodc1.Recordset!incident & " " & Adodc1.Recordset!datereported vbemail.Message = "Hi Sir/Ma'am" & Chr(13) & Chr(13) & "IR NO. : " & Adodc1.Recordset!irno & Chr(13) & "STATUS: " & Adodc1.Recordset!Status & Chr(13) & "PROBLEM CLASSIFICATION: " & Adodc1.Recordset!problemclassification & Chr(13) & "PROBLEM: " & Adodc1.Recordset!problem & Chr(13) & "RESOLUTION: " & Adodc1.Recordset!resolution & Chr(13) & Chr(13) & "WEBSITE: " & Adodc1.Recordset!websitename & Chr(13) & "DETAILS:" & Adodc1.Recordset!details & Chr(13) & "URL / LINK: " & Adodc1.Recordset!url & Chr(13) & "BROWSER USED: " & Adodc1.Recordset!browsertype & Chr(13) & Chr(13) & fulln & Chr(13) & departmnt vbemail.Send Set vbemail = Nothing MsgBox "Email Sent", vbExclamation
Thanks in advance for any assistance on this dilemma :-O
Aim small, miss small
-
Hello! I've an application that uses vbSendMail.dll for emails. When in debug mode the application works smoothly. However once I've compiled/packaged the app using VS package and deployment wizard it does not send emails. Weird thing is it does not generate any error. vbSendMail.dll and mswinsck.ocx both have been included in the package and registered successfully. By the way I'm using vb6 for this app. This is the part of the email code
Set vbemail = New vbSendMail.clsSendMail
vbemail.SMTPHost = "****.*****.***"
vbemail.FromDisplayName = ""
sendemail
...................
vbemail.From = senderemail
vbemail.CcRecipient = "*********"
For i = 1 To Adodc3.Recordset.RecordCount
vbemail.Recipient = vbemail.Recipient + Adodc3.Recordset!email + ";"
Adodc3.Recordset.MoveNext
Next iIf Not txtemail.Text = "" Then vbemail.CcRecipient = vbemail.CcRecipient + ";" + txtemail.Text End If vbemail.Attachment = Adodc1.Recordset!screenshot vbemail.Subject = "\[INCIDENT\] WSA " & Adodc1.Recordset!incident & " " & Adodc1.Recordset!datereported vbemail.Message = "Hi Sir/Ma'am" & Chr(13) & Chr(13) & "IR NO. : " & Adodc1.Recordset!irno & Chr(13) & "STATUS: " & Adodc1.Recordset!Status & Chr(13) & "PROBLEM CLASSIFICATION: " & Adodc1.Recordset!problemclassification & Chr(13) & "PROBLEM: " & Adodc1.Recordset!problem & Chr(13) & "RESOLUTION: " & Adodc1.Recordset!resolution & Chr(13) & Chr(13) & "WEBSITE: " & Adodc1.Recordset!websitename & Chr(13) & "DETAILS:" & Adodc1.Recordset!details & Chr(13) & "URL / LINK: " & Adodc1.Recordset!url & Chr(13) & "BROWSER USED: " & Adodc1.Recordset!browsertype & Chr(13) & Chr(13) & fulln & Chr(13) & departmnt vbemail.Send Set vbemail = Nothing MsgBox "Email Sent", vbExclamation
Thanks in advance for any assistance on this dilemma :-O
Aim small, miss small
-
Hello! I've an application that uses vbSendMail.dll for emails. When in debug mode the application works smoothly. However once I've compiled/packaged the app using VS package and deployment wizard it does not send emails. Weird thing is it does not generate any error. vbSendMail.dll and mswinsck.ocx both have been included in the package and registered successfully. By the way I'm using vb6 for this app. This is the part of the email code
Set vbemail = New vbSendMail.clsSendMail
vbemail.SMTPHost = "****.*****.***"
vbemail.FromDisplayName = ""
sendemail
...................
vbemail.From = senderemail
vbemail.CcRecipient = "*********"
For i = 1 To Adodc3.Recordset.RecordCount
vbemail.Recipient = vbemail.Recipient + Adodc3.Recordset!email + ";"
Adodc3.Recordset.MoveNext
Next iIf Not txtemail.Text = "" Then vbemail.CcRecipient = vbemail.CcRecipient + ";" + txtemail.Text End If vbemail.Attachment = Adodc1.Recordset!screenshot vbemail.Subject = "\[INCIDENT\] WSA " & Adodc1.Recordset!incident & " " & Adodc1.Recordset!datereported vbemail.Message = "Hi Sir/Ma'am" & Chr(13) & Chr(13) & "IR NO. : " & Adodc1.Recordset!irno & Chr(13) & "STATUS: " & Adodc1.Recordset!Status & Chr(13) & "PROBLEM CLASSIFICATION: " & Adodc1.Recordset!problemclassification & Chr(13) & "PROBLEM: " & Adodc1.Recordset!problem & Chr(13) & "RESOLUTION: " & Adodc1.Recordset!resolution & Chr(13) & Chr(13) & "WEBSITE: " & Adodc1.Recordset!websitename & Chr(13) & "DETAILS:" & Adodc1.Recordset!details & Chr(13) & "URL / LINK: " & Adodc1.Recordset!url & Chr(13) & "BROWSER USED: " & Adodc1.Recordset!browsertype & Chr(13) & Chr(13) & fulln & Chr(13) & departmnt vbemail.Send Set vbemail = Nothing MsgBox "Email Sent", vbExclamation
Thanks in advance for any assistance on this dilemma :-O
Aim small, miss small
I don't have the solution to your problem but I do have code that will work for you try:
Dim myMail As New MailMessage()
Dim eFrom As New MailAddress("*****@****.***")
myMail.From = eFrommyMail.To.Add("\*\*\*\*\*@\*\*\*\*\*.\*\*\*") myMail.Subject = "Your subject" myMail.Priority = MailPriority.High myMail.Body = "Your message" Dim myAttachment As New Attachment("your attachment")
myMail.Attachments.Add(myAttachment)
Dim smtpClient As New SmtpClient("\*\*.\*\*.\*\*.\*\*") 'Whatever your mail server address is smtpClient.Send(myMail)
Replacing any * with the proper character and leaving out anything you don't need. Also remember to import Imports System.Net.Mail
-
I don't have the solution to your problem but I do have code that will work for you try:
Dim myMail As New MailMessage()
Dim eFrom As New MailAddress("*****@****.***")
myMail.From = eFrommyMail.To.Add("\*\*\*\*\*@\*\*\*\*\*.\*\*\*") myMail.Subject = "Your subject" myMail.Priority = MailPriority.High myMail.Body = "Your message" Dim myAttachment As New Attachment("your attachment")
myMail.Attachments.Add(myAttachment)
Dim smtpClient As New SmtpClient("\*\*.\*\*.\*\*.\*\*") 'Whatever your mail server address is smtpClient.Send(myMail)
Replacing any * with the proper character and leaving out anything you don't need. Also remember to import Imports System.Net.Mail