|
-
May 19th, 2008, 09:42 AM
#1
Thread Starter
Addicted Member
Vbsendmail
Hi gurus
I am trying to sedn email using the vbsendmail on my VB6 version, I know, I know,"update" but I really would like this to work and here is my problem.
I can send emails internally with or without attachment but for some reason I cant send email to outside the company, we host our own exchange server 2000 and I would like to send email out of my domain, not just within our domain.
here is what I have so far with the help of you guys.
Code:
Dim stringmessage As String
Dim stringmessage2 As String
Dim stringmessage3 As String
' initialize the component
Set poSendMail = New clsSendMail
stringmessage = "test1"
stringmessage2 = "test2"
stringmessage3 = "test3"
poSendMail.SMTPHost = "my server name"
poSendMail.From = "[email protected]"
poSendMail.Recipient = "[email protected]"
poSendMail.Subject = "Outside email test"
poSendMail.Attachment = "test.txt"
poSendMail.Message = vbCrLf & stringmessage & vbCrLf & vbCrLf & stringmessage2 & vbCrLf & vbCrLf & stringmessage3
poSendMail.Send
End
Thanks for any help I can get guys
-
May 19th, 2008, 10:35 AM
#2
Re: Vbsendmail
What happens when you try to send it outside your domain?
-
May 19th, 2008, 11:08 AM
#3
Thread Starter
Addicted Member
Re: Vbsendmail
Thanks Hack
Nothing happens, The code ends up ok, no error comes up, if this might help
1)I can send internal email, even if I use a non-valid email as the from and copy valid email as ccrecip.
2) I cannot send email if I use non-valid email as the from and valid email outside
3) I can not send email if I use a valid email as the from but outside email.
So if the recipient is outside I can not send. I get no error, the program ends fine.
Thanks again hack
-
May 19th, 2008, 04:26 PM
#4
Re: Vbsendmail
does your company mail server forward emails to outside?
are you sending emails outside from outlook, outlook express or any other mail client? if so is that client using the company mail server or some other?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 19th, 2008, 09:34 PM
#5
Thread Starter
Addicted Member
Re: Vbsendmail
thanks west
I Have exchange server , I am not using OL,OE or any other amil client to send this email and no my exchange server is not an open relay.
Thanks
-
May 19th, 2008, 10:30 PM
#6
Re: Vbsendmail
and no my exchange server is not an open relay.
then you can not send an email to outside using that server, you will need to find some other server you can use, does your intrernet service provider have an outgoing mail server you can use?
I am not using OL,OE or any other amil client to send this email
that was not the question, do you use any of those to send other emails to outside email addresses? if so you should be able to use the smtp server in the settings for those programs
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
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
|