Results 1 to 6 of 6

Thread: Vbsendmail

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Vbsendmail

    What happens when you try to send it outside your domain?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    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

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    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

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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
  •  



Click Here to Expand Forum to Full Width