+ Reply to Thread
Results 1 to 6 of 6

Body for e-mail using sendMail

  1. #1
    Tempy
    Guest

    Body for e-mail using sendMail

    Hi all, i am using ActiveWorkbook.SendMail mySuppName, "Latest
    Reconciliation " & myDate, True
    To send an e-mail and it works great, i just need to write a message, as
    the above only has the possibility to put in the address and the subject
    ?
    Any suggestions or help would be appreciated.



    Tempy

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    JNW
    Guest

    RE: Body for e-mail using sendMail

    Try the following instead of send mail:

    Sub email()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim EmailAddr As String
    Dim Subj As String
    Dim BodyText As String

    EmailAddr = "[email protected]"
    Subj = "Your subject"

    BodyText = "your subject"

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    With OutMail
    .to = EmailAddr
    .CC = ""
    .BCC = ""
    .Subject = Subj
    .Body = BodyText
    .Attachments.Add ActiveWorkbook.FullName
    .Display 'or use .send
    End With

    Set OutMail = Nothing
    Set OutApp = Nothing
    End sub

    "Tempy" wrote:

    > Hi all, i am using ActiveWorkbook.SendMail mySuppName, "Latest
    > Reconciliation " & myDate, True
    > To send an e-mail and it works great, i just need to write a message, as
    > the above only has the possibility to put in the address and the subject
    > ?
    > Any suggestions or help would be appreciated.
    >
    >
    >
    > Tempy
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >


  3. #3
    Tempy
    Guest

    RE: Body for e-mail using sendMail

    Thanks JNW, will try it in the morning as It is now 18:45 here and way
    past me home time !!

    thanks again.

    Tempy

    *** Sent via Developersdex http://www.developersdex.com ***

  4. #4
    Ron de Bruin
    Guest

    Re: Body for e-mail using sendMail

    This is only working if the OP is using Outlook
    For other code see
    http://www.rondebruin.nl/sendmail.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "JNW" <[email protected]> wrote in message news:[email protected]...
    > Try the following instead of send mail:
    >
    > Sub email()
    > Dim OutApp As Object
    > Dim OutMail As Object
    > Dim EmailAddr As String
    > Dim Subj As String
    > Dim BodyText As String
    >
    > EmailAddr = "[email protected]"
    > Subj = "Your subject"
    >
    > BodyText = "your subject"
    >
    > Set OutApp = CreateObject("Outlook.Application")
    > Set OutMail = OutApp.CreateItem(0)
    >
    > With OutMail
    > .to = EmailAddr
    > .CC = ""
    > .BCC = ""
    > .Subject = Subj
    > .Body = BodyText
    > .Attachments.Add ActiveWorkbook.FullName
    > .Display 'or use .send
    > End With
    >
    > Set OutMail = Nothing
    > Set OutApp = Nothing
    > End sub
    >
    > "Tempy" wrote:
    >
    >> Hi all, i am using ActiveWorkbook.SendMail mySuppName, "Latest
    >> Reconciliation " & myDate, True
    >> To send an e-mail and it works great, i just need to write a message, as
    >> the above only has the possibility to put in the address and the subject
    >> ?
    >> Any suggestions or help would be appreciated.
    >>
    >>
    >>
    >> Tempy
    >>
    >> *** Sent via Developersdex http://www.developersdex.com ***
    >>




  5. #5
    Tempy
    Guest

    Re: Body for e-mail using sendMail

    Hi Ron, thank you very much. Just one more question, i see you can wrap
    the text if you put it in the code.
    "This is line 1" & vbNewLine & _
    "This is line 2" & vbNewLine & _
    "This is line 3" & vbNewLine & _
    "This is line 4"

    How would one wrap the text put in via an input box ?

    Tempy

    *** Sent via Developersdex http://www.developersdex.com ***

  6. #6
    Ron de Bruin
    Guest

    Re: Body for e-mail using sendMail

    Hi

    Use this then

    strbody = InputBox("Enter your text")


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Tempy" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron, thank you very much. Just one more question, i see you can wrap
    > the text if you put it in the code.
    > "This is line 1" & vbNewLine & _
    > "This is line 2" & vbNewLine & _
    > "This is line 3" & vbNewLine & _
    > "This is line 4"
    >
    > How would one wrap the text put in via an input box ?
    >
    > Tempy
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1