|
-
Oct 9th, 2006, 07:43 AM
#1
Thread Starter
Hyperactive Member
[2005] Emailing
How is writing code to send an email any different than sending one manually through Outlook?
25 people in my company donated their personal email addresses for the test portion of a project. As of today about 11 emails were rejected for the following reason:
Code:
The following recipient(s) could not be reached:
[email protected] on 10/7/2006 1:25 PM
Could not deliver the message in the time limit specified. Please retry or contact your administrator.
<(MY PC NAME).firstads.firstcare.com #4.4.7>
Code:
Public Sub sendNewMessage(ByVal emailmsg)
Dim myEmail As New MailMessage
Dim attachFile As New Attachment("c:\FileName.pdf")
myEmail.Attachments.Add(attachFile)
myEmail.To.Add(Me.EmailTo)
myEmail.From = New MailAddress(Me.EmailFrom)
myEmail.Subject = (Me.EmailSubject)
myEmail.Body = Me.EmailBody
Dim smtp As New SmtpClient("127.0.0.1")
'Dim smtp As New SmtpClient("mail.company.com")
smtp.Send(myEmail)
End Sub
-
Oct 17th, 2006, 01:12 PM
#2
Thread Starter
Hyperactive Member
-
Oct 17th, 2006, 02:47 PM
#3
Re: [2005] Emailing
Does this code operate on the Email server?
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Oct 17th, 2006, 02:57 PM
#4
Re: [2005] Emailing
127.0.0.1 is not a valid SMTP server unless you are running a correctly configured SMTP server on your PC (or the PC this code is running on)
which is probably what ComputerJy is getting at.
In outlook, when you setup an account, you specify the SMTP settings (with POP3 for example) which is how outlook knows how to send the email. It doesn't use localhost do it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|