AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with Mailto link
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
iason



Joined: 01 Nov 2005
Posts: 125

PostPosted: Wed Mar 28, 2007 8:43 pm    Post subject: Help with Mailto link Reply with quote

AHK works with mailto links. You can do
Code:
run, mailto:somebody@somemail.com?subject=Mail subject&body=Dear Sir,


Any idea about how to insert line-breaks in "body"?
Can the body-text be for example
Dear Sir,
I saw in your webpage that...
bla bla...

_________________
help to be helped
Back to top
View user's profile Send private message
iason



Joined: 01 Nov 2005
Posts: 125

PostPosted: Wed Mar 28, 2007 8:53 pm    Post subject: Re: Help with Mailto link Reply with quote

I found it:
Code:
run, mailto:somebody@somemail.com?subject=Mail subject&body=Dear Sir`,`%0Asecond line...


"`%0A" makes a line break. Wink
_________________
help to be helped
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Wed Mar 28, 2007 8:57 pm    Post subject: Reply with quote

Quote:
you must use ASCII hexadecimal equivalents as variables for punctuation characters.
Eg. the following variables are used to represent commonly used characters:

Space ( ) %20
Comma (,) %2C
Question Mark (?) %3F
Period (.) %2E
Exclamation Point (!) %21
Colon (Smile %3A
Semicolon (Wink %3B
Back to top
iason



Joined: 01 Nov 2005
Posts: 125

PostPosted: Wed Mar 28, 2007 9:00 pm    Post subject: Reply with quote

Thanks for the info Bobo. Just edit your post, they mess with smilies... for everyone to know. Wink
_________________
help to be helped
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Wed Mar 28, 2007 9:09 pm    Post subject: Reply with quote

Code:
   you must use ASCII hexadecimal equivalents as variables for punctuation characters.
   The following variables are used to represent commonly used characters:
 
      Space ( ) %20
      Comma (,) %2C
      Question Mark (?) %3F
      Period (.) %2E
      Exclamation Point (!) %21
      Colon (:) %3A
      Semicolon (;) %3B
Cool
Back to top
Rhys



Joined: 17 Apr 2007
Posts: 710
Location: Florida

PostPosted: Mon Aug 06, 2007 1:18 pm    Post subject: Reply with quote

This topic has already helped me out a lot, but does anyone know how to get a % sign in the body to work?

Code:
run, mailto:somebody@somemail.com?subject=Mail subject&body=This does not work 100% at all!

Results in:
This does not work 100?0at all!

I know this is more of a mailto question and not really related to AHK, but if you know how to get mailto do display that % I'd love to know!
_________________
[Join IRC!]
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1158
Location: Denmark

PostPosted: Mon Aug 06, 2007 1:26 pm    Post subject: Reply with quote

Code:
Percent %25

URL Encoding
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 710
Location: Florida

PostPosted: Wed Aug 08, 2007 4:56 pm    Post subject: Reply with quote

Code:
run, mailto:somebody@somemail.com?subject=Mail subject&body=This works 100`%25! All right!!


Thanks - That page looks like a great resource too.
_________________
[Join IRC!]
Back to top
View user's profile Send private message
t0rch1t



Joined: 17 Aug 2007
Posts: 10

PostPosted: Fri Sep 07, 2007 8:37 pm    Post subject: Sending email with attachments. Reply with quote

Rhys wrote:
Code:
run, mailto:somebody@somemail.com?subject=Mail subject&body=This works 100`%25! All right!!

Is there anyway to add an attachment to the email using this method? I am trying to write a script that will send an attachment. I tried the following code, but it bombs when it gets to where I enter the name of the file I want to send. The email client is outlook. Thanks for any help.

Code:
run, mailto:someuser@somehost.com
sleep, 1000
ifwinnotactive, Untitled Message,,winactivate, Untitled Message,
send,Problems with server{ENTER}
send ,{ALTDOWN}il
send, c:\goodcount.txt
send,{ALTDOWN}s
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Sep 07, 2007 9:42 pm    Post subject: Reply with quote

you may have to have another winwait for the file attachment dialog before sending the file name. Alternately, instead of attaching the file, you could read the contents of the file onto the clipboard, then paste into the email.

You are also only using Alt down, and not releasing the key (also note {alt down} vs {altdown}

a few versions to try
Code:

run, mailto:someuser@somehost.com
sleep, 1000
ifwinnotactive, Untitled Message,,winactivate, Untitled Message,
send,Problems with server{ENTER}
send ,{ALT DOWN}il{alt up}
send, c:\goodcount.txt{enter}
send,{ALT DOWN}s{alt up}

Code:

run, mailto:someuser@somehost.com
sleep, 1000
ifwinnotactive, Untitled Message,,winactivate, Untitled Message,
send,Problems with server{ENTER}
send ,!il
send, c:\goodcount.txt{enter}
send,!s

Code:

run, mailto:someuser@somehost.com
sleep, 1000
ifwinnotactive, Untitled Message,,winactivate, Untitled Message,
send,Problems with server{ENTER}
FileRead, clipboard, c:\goodcount.txt
sleep, 100
send, ^v{enter}
send,!s

_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
garry



Joined: 19 Apr 2005
Posts: 1017
Location: switzerland

PostPosted: Fri Sep 07, 2007 9:50 pm    Post subject: Reply with quote

this works with thunderbird
Code:
      ;---------------------- SEND EMAIL ATTACHMENTS THUNDERBIRD MOZILLA -----------
      ;   make a subfolder EMAILSTOSEND  put here your files

      I:=0
      Loop,%A_scriptdir%\EMAILSTOSEND\*,,1
        {
        I++
        filex=%filex%,file:///%A_LoopFileFullPath%
        }
      stringlen,L1,filex
      stringmid,filex,filex,2,L1

      TO2=garry@aolnet.tv               ;first your adress here to test
      TO=to='%TO2%'
      stringsplit,CX,TO2,`@,            ;not needed get variable CX1 maybe replace CX1 later
      DATES=%A_DD%-%A_MM%-%A_YYYY%      ;not needed just a datum
      PR=%A_ProgramFiles%\Mozilla Thunderbird\thunderbird.exe
      SB=subject=My subject
      AT=attachment='%FILEX%'
      BD=body=Hallo %CX1%`%0A`%0AHow are you ?`%0AI send you %I% files`%0A`%0AGreetings`%2C`%0A garry
      ALL=%TO%,%SB%,%AT%,%BD%
      run,%PR% -compose "%ALL%"
      return
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 710
Location: Florida

PostPosted: Fri Sep 07, 2007 10:03 pm    Post subject: Reply with quote

This isn't working in Outlook, but I think it should:
Code:
Mailto=Me@test.com
Subject=Testing Attachment
Body=Hi, does it work
File="C:\WebCenterStatus2.txt"
run, mailto:%mailto%?subject=%subject%&body=%body%&attachment=%file%


I'll look at it more on Monday... It's the WEEKEND!!
_________________
[Join IRC!]
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 710
Location: Florida

PostPosted: Mon Sep 10, 2007 1:29 pm    Post subject: Reply with quote

All of the documentation that I'm finding online points to this syntax being correct, but Outlook isn't attaching my file.

Can anyone try the following two commands in a CMD window and let me know if they work? (C:\test.txt should exist)
rundll32 url.dll,FileProtocolHandler mailto:test@test.com&attachment="C:\test.txt"
rundll32 url.dll,FileProtocolHandler mailto:test@test.com&attachment="C:\\test.txt"
_________________
[Join IRC!]
Back to top
View user's profile Send private message
iason



Joined: 01 Nov 2005
Posts: 125

PostPosted: Thu Sep 13, 2007 10:11 pm    Post subject: Reply with quote

None of them works.
This works: rundll32 url.dll,FileProtocolHandler mailto:test@test.com?body=bla
Probably something is wrong with the '&' - but i have no idea... Embarassed
_________________
help to be helped
Back to top
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 829
Location: London, UK

PostPosted: Thu Sep 13, 2007 11:48 pm    Post subject: Reply with quote

Code:
Outlook.exe /c ipm.note /m test@test.com c:\test.txt


Just running this works for me
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group