Results 1 to 10 of 10

Thread: Smtp

  1. #1
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185

    Question Unanswered: Smtp

    Hi
    I use SMTP protocol for transferring daily reports to parties in my db and I wonder if it is possible to put a hyperlink in the body of E-Mail or not?
    Thanks
    Last edited by Aran1; 04-09-08 at 08:01.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    erm have you tried it?
    I'm always baffled by people asking if its possible to do something before actaully trying it out themselves

  3. #3
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    I never open a new thread before trying and searching the internet for solutions at list for few days, so you shouldn't be baffled healdem
    Last edited by Aran1; 04-09-08 at 08:00.

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yes, it's possible. You just have to send the e-mail in HTML format and write out the HTML required to generate the link in the body of the e-mail. Unless there's an easier way I haven't found, which is always possible as I still tend to overcomplicate things
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Thanks StarTrekker
    I set objEmail.IsBodyHtml = True in my code, and send the E Mail but the received body text is not a hyperlink yet

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Fancy posting the full code?
    George
    Home | Blog

  7. #7
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Here is the full code:
    PHP Code:
    Public Sub SendEmailCDO1() 
    Dim objEmail As Object


    On Error Resume Next

    Set objEmail 
    CreateObject("CDO.Message")
    objEmail.FROM "Sender Address"

    objEmail.To "Receiver address"

    objEmail.Subject "Subject"
    objEmail.IsBodyHtml True

    objEmail
    .textbody "Some Text" vbCrLf vbCrLf "Some Other Text which should be hyperlink"

    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2


    objEmail
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtpserver"

    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

    objEmail
    .Configuration.Fields.Update

    objEmail
    .Send

    Set objEmail 
    Nothing

    End Sub 

  8. #8
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Use htmlbody rather than textbody, and construct the body with html tags.

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    Dim msg As String
    
    msg = "Here is some text... <br />"
    msg = msg & "<a href='http://www.dbforums.com'>here's a link</a>"
    
    objEmail.htmlbody = msg
    George
    Home | Blog

  10. #10
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Thanks a Lot, it works now.
    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •