These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Can't get sendMail to work, is it broken?

Author
m3talc0re X
The Motley Crew of Disorder
The Gorram Shiney Alliance
#1 - 2013-07-11 04:40:59 UTC
I know at one time it wasn't functional, but it seems to be working now according to the eve wiki. But I'm trying it and it's not working. I've granted trust to the site with:
onload="CCPEVE.requestTrust('http://www.site.com/')" in the body

and the link is:
a href="javascript:CCPEVE.sendMail(UserID)"

But in game, it's not doing anything
Kid Delicious
Caldari Provisions
Caldari State
#2 - 2013-07-11 07:09:25 UTC
CCPEVE.sendMail(92010293, 'testing', 'ok');

Try filling out the second two parameters. (That id was random)
m3talc0re X
The Motley Crew of Disorder
The Gorram Shiney Alliance
#3 - 2013-07-11 07:37:59 UTC
Nope, still not working.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#4 - 2013-07-11 09:49:45 UTC
take the javascript out of the href tag and try sticking it in an onclick instead.

something like
< span onclick="CCPEVE.sendMail(UserID)">send mail< /span>

did you reload the page after requesting trust?


if that doesn't work, try
< span onclick="CCPEVE.sendMail(UserID,subject,text)">send mail< /span>

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Kid Delicious
Caldari Provisions
Caldari State
#5 - 2013-07-11 18:43:02 UTC
jsconsole.com Give it a try in there. The line I posted before worked for me (without all three parameters it did nothing, like you said).
m3talc0re X
The Motley Crew of Disorder
The Gorram Shiney Alliance
#6 - 2013-07-15 21:39:55 UTC
I still can't get it to work. It just wont do anything. Do I need anything else in the header? Besides just the onload trust in the body tag I mean.
I tried
< a onclick="CCPEVE.sendMail(1318498295, testing, ok)">Send m3talc0re X mail< /a>
< a onclick="CCPEVE.sendMail(1318498295,testing,ok)">Send m3talc0re X mail< /a>
< a onclick="CCPEVE.sendMail(1318498295, 'testing', 'ok')">Send m3talc0re X mail< /a>
and those same variants with javascript: in the href.
Louis Vitton
Viziam
Amarr Empire
#7 - 2013-07-16 02:50:16 UTC
I have the function working fine using this example:
< span onclick="CCPEVE.sendMail(1180086294, 'Happy birthday', 'Congrats')">send mail< /span>
What i have done is set trust manually to the site. If you could also manually set up trust for the site.
This is done under options -> trust sites
please let me know how you go with it.
Abus Finkel
Caldari Capital Construction Inc.
#8 - 2013-07-16 12:18:39 UTC
m3talc0re X wrote:
I still can't get it to work. It just wont do anything. Do I need anything else in the header? Besides just the onload trust in the body tag I mean.
I tried
< a onclick="CCPEVE.sendMail(1318498295, testing, ok)">Send m3talc0re X mail< /a>
< a onclick="CCPEVE.sendMail(1318498295,testing,ok)">Send m3talc0re X mail< /a>
< a onclick="CCPEVE.sendMail(1318498295, 'testing', 'ok')">Send m3talc0re X mail< /a>
and those same variants with javascript: in the href.

You need to quote those strings. "testing" and 'testing' are strings, testing is a (most likely undefined) variable.
m3talc0re X
The Motley Crew of Disorder
The Gorram Shiney Alliance
#9 - 2013-07-16 17:39:50 UTC
Look at that last one listed Abus
Abus Finkel
Caldari Capital Construction Inc.
#10 - 2013-07-17 08:18:48 UTC  |  Edited by: Abus Finkel
Oh right, I missed that. Sorry.
Not sure what's wrong then. I tried the exact same setup as you have with the trust request in body.onload and it works fine. Are you sure you are passing the correct URL to requestTrust()? Does it work if you add it manually?
Do you get the trusted website icon in the bottom right corner?
m3talc0re X
The Motley Crew of Disorder
The Gorram Shiney Alliance
#11 - 2013-07-20 09:15:54 UTC  |  Edited by: m3talc0re X
Now the **** magically works. Wtf? smh...

I think it was manually adding trust to the page that did it. The onload in the body isn't working. The page is here:
http://helpmymission.com/m3tals-test-page/

Edit: I have this: onload="CCPEVE.requestTrust('http://www.helpmymission.com/')" in the < body>, but I think since WP is doing the url to the page like it's a subdirectory, the requestTrust for the top level domain isn't working. That's my best guess.

Edit again: Yeah, I don't think there's any way around it. I can't request trust for every page like that and have the user refresh after doing it, etc... Just going to do showInfo for it.
Somerset Mahm
Cognitive Distortion
#12 - 2013-07-20 17:51:40 UTC
You can request trust for wildcard URLs. You're going to helpmymission.com but requesting trust for www.

CCPEVE.requestTrust("http://*.helpmymission.com/")

SOMER Blink Microlotteries that finish in minutes! Running for over 2 years :)

m3talc0re X
The Motley Crew of Disorder
The Gorram Shiney Alliance
#13 - 2013-07-20 19:56:25 UTC
Odd, I replied earlier and said that I didn't notice the www wasn't there and I'd give it a shot with the wildcard, but the post is gone? 0_o

Anyway, tried it with that Somerset and it's working so far I think. Thanks XD I think that wildcard bit needs to be added to the wiki about it...
Louis Vitton
Viziam
Amarr Empire
#14 - 2013-07-21 12:41:54 UTC
I find eve-id.net normally has up to date info.
http://wiki.eve-id.net/IGB_Javascript_Functions#Examples_2