Jump to content
Sign in to follow this  
crystalburner

_Inetsend

Recommended Posts

crystalburner

Hey!

I have used _Inetsend to create a new email message, but ...

I want to put the recipients in the bcc field not the to...

Anyone got a sharp idea? :lmao:

Share this post


Link to post
Share on other sites
Fossil Rock

There's a _Inetsend command in AUtoIT now ??!!! Cool, I need to look into that.


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
BitRot

I have used _Inetsend to create a new email message, ... Anyone got a sharp idea?

Yeah. Tell me where you got that command from, as it does not appear in my copy of AI ... :lmao:

I take it you ment "_InetSmtpMail" ?

If so, you will have to update the origional functions code (in the "inet.au3" file, located in your include-folder), or create a new function allso containing an "$s_CcAddres" -argument, based on that origional one.

The "CC:" line looks pretty-much like the "To:" line, only you can just place the CC-recipients E-mail adresses in there, seperated by semi-colons :

CC: Someone1@Server1;Someone2@server2

Just insert it into the "$s_Send[4]" -variable (preferrably, but not nessecarily under the "To:" -line), and you're good to go.

Hope that helps.

Share this post


Link to post
Share on other sites
crystalburner

Yeah. Tell me where you got that command from, as it does not appear in my copy of AI ... :lmao:

I take it you ment "_InetSmtpMail" ?

If so, you will have to update the origional functions code (in the "inet.au3" file, located in your include-folder), or create a new function allso containing an "$s_CcAddres" -argument, based on that origional one.

The "CC:" line looks pretty-much like the "To:" line, only you can just place the CC-recipients E-mail adresses in there, seperated by semi-colons :Just insert it into the "$s_Send[4]" -variable (preferrably, but not nessecarily under the "To:" -line), and you're good to go.

Hope that helps.

sorry its this one

#include <INet.au3>

_INetMail ( $s_MailTo, $s_MailSubject, $s_MailBody )

u can only specify $s_mailto not $s_mailbcc

Share this post


Link to post
Share on other sites
crystalburner

sorry its this one

#include <INet.au3>

_INetMail ( $s_MailTo, $s_MailSubject, $s_MailBody )

u can only specify $s_mailto not $s_mailbcc

hmm maybe a little hackeroo of the include

Func _INetMail($s_MailTo, $s_MailSubject, $s_MailBody)

Local $prev = opt("ExpandEnvStrings", 1)

Local $var = RegRead('HKCR\mailto\shell\open\command', "")

Local $ret = Run(StringReplace($var, '%1', _INetExplorerCapable('mailto:' & $s_MailTo & '?subject=' & $s_MailSubject & '&bcc=' & $s_MailBody)))

opt("ExpandEnvStrings", $prev)

Return $ret

EndFunc ;==>_INetMail

Share this post


Link to post
Share on other sites
crystalburner

hmm maybe a little hackeroo of the include

Func _INetMail($s_MailTo, $s_MailSubject, $s_MailBody)

Local $prev = opt("ExpandEnvStrings", 1)

Local $var = RegRead('HKCR\mailto\shell\open\command', "")

Local $ret = Run(StringReplace($var, '%1', _INetExplorerCapable('mailto:' & $s_MailTo & '?subject=' & $s_MailSubject & '&bcc=' & $s_MailBody)))

opt("ExpandEnvStrings", $prev)

Return $ret

EndFunc ;==>_INetMail

YEP! perfecto!!!

Share this post


Link to post
Share on other sites
BitRot

YEP! perfecto!!!

Not quite : the origional mailbody has disappeared, and the code is not compatible with the origional anymore (which could cause strange results when used by example (not written by yourself) scripts). :lmao:

You can replace the "_InetMail" function with the below. It ADDS a CC and BCC option to it (meaning : you can use it as normal, and with the new options) :

Func _INetMail($s_MailTo, $s_MailSubject, $s_MailBody,$s_CCTo="",$s_BCCTo="")
    Local $prev = opt("ExpandEnvStrings", 1)
    Local $var = RegRead('HKCR\mailto\shell\open\command', "")
    local $argument='mailto:' & $s_MailTo & '?subject=' & $s_MailSubject
    if $s_CCTo>"" then $argument &= '&cc=' & $s_CCTo
    if $s_BCCTo>"" then $argument &= '&bcc=' & $s_BCCTo
    $argument &= '&body=' & $s_MailBody
    Local $ret = Run(StringReplace($var, '%1', _INetExplorerCapable($argument)))
    opt("ExpandEnvStrings", $prev)
    Return $ret
EndFunc   ;==>_INetMail

Hope that helps.

Edited by BitRot

Share this post


Link to post
Share on other sites
wysocki

Very nice! Now is there any way to change the "Sender" field? I'd like to change the sender to something like "Automated Message". I looked at the mailto: docs and don't see it listed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×