hello im am useing http://forums.bukkit.org/threads/library-lightweight-email-send-emails-from-plugins.101927/ but it will not work what am im doing wrong? Here the code Code:java Code:java package me.GRANTSWIM4.EHTracker; import org.bukkit.plugin.java.JavaPlugin; public final class Main extends JavaPlugin{ public void onEnable(){getLogger().info("Sending Test email");Email email = new Email();email.sendEmail(Providers.GMAIL, "E mail it going to","Sending Email", "password", "Hi! This is a test subject!", "Hi! How are you today?"); } public void onDisable(){getLogger().info("Disableing goodbye");} }[FONT=Consolas][/FONT] The LIB code Code:java Code:java package me.GRANTSWIM4.EHTracker; import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.IOException;import java.net.Socket; public class Email { @SuppressWarnings("deprecation")public void sendEmail(Providers provider, String to, String from,String password, String content, String subject, int port) { String HOST = provider.getHost(); String PASSWORD = Base64Coder.encodeString(password);String USER = Base64Coder.encodeString(from);; try {Socket socket = new Socket(HOST, port); DataOutputStream dos = new DataOutputStream(socket.getOutputStream());DataInputStream is = new DataInputStream(socket.getInputStream()); dos.writeBytes("HELO\r\n");dos.writeBytes("AUTH LOGIN");dos.writeBytes("\r\n");dos.writeBytes(USER);dos.writeBytes("\r\n");dos.writeBytes(PASSWORD);dos.writeBytes("\r\n");dos.writeBytes("MAIL FROM:<" + from + ">\r\n");dos.writeBytes("\r\n");dos.writeBytes("RCPT TO: <" + to + ">\r\n");dos.writeBytes("DATA\r\n");dos.writeBytes("Subject: "+subject+"\r\n");dos.writeBytes(content);dos.writeBytes("\r\n.\r\n");dos.writeBytes("QUIT\r\n"); dos.flush(); String responseline;while ((responseline = is.readLine()) != null) {System.out.println(responseline);} is.close();dos.close();socket.close();} catch (IOException ex) {System.err.println(ex);} } public void sendEmail(Providers provider, String to, String from,String password, String content, String subject) { sendEmail(provider, to, from, password, content, subject, 25); // Use default// port } } class Base64Coder { private static final char[] map1 = new char[64];static {int i = 0;for (char c = 'A'; c <= 'Z'; c++)map1[i++] = c;for (char c = 'a'; c <= 'z'; c++)map1[i++] = c;for (char c = '0'; c <= '9'; c++)map1[i++] = c;map1[i++] = '+';map1[i++] = '/';} private static final byte[] map2 = new byte[128];static {for (int i = 0; i < map2.length; i++)map2[I] = [/I]-1;for (int i = 0; i < 64; i++)map2[map1] = (byte) i;} public static String encodeString(String s) {return new String(encode(s.getBytes()));} public static char[] encode(byte[] in) {return encode(in, 0, in.length);} public static char[] encode(byte[] in, int iLen) {return encode(in, 0, iLen);} public static char[] encode(byte[] in, int iOff, int iLen) {int oDataLen = (iLen * 4 + 2) / 3;int oLen = ((iLen + 2) / 3) * 4;char[] out = new char[oLen];int ip = iOff;int iEnd = iOff + iLen;int op = 0;while (ip < iEnd) {int i0 = in[ip++] & 0xff;int i1 = ip < iEnd ? in[ip++] & 0xff : 0;int i2 = ip < iEnd ? in[ip++] & 0xff : 0;int o0 = i0 >>> 2;int o1 = ((i0 & 3) << 4) | (i1 >>> 4);int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);int o3 = i2 & 0x3F;out[op++] = map1[o0];out[op++] = map1[o1];out[op] = op < oDataLen ? map1[o2] : '=';op++;out[op] = op < oDataLen ? map1[o3] : '=';op++;}return out;} private Base64Coder() {} }[FONT=Consolas][/FONT] Code: 2012-12-29 17:53:15 [SEVERE] Error occurred while enabling EH Tracker v1.0 (Is it up to date?) java.lang.Error: Unresolved compilation problem: at me.GRANTSWIM4.EHTracker.Base64Coder.encodeString(Email.java:94) at me.GRANTSWIM4.EHTracker.Email.sendEmail(Email.java:17) at me.GRANTSWIM4.EHTracker.Email.sendEmail(Email.java:64) at me.GRANTSWIM4.EHTracker.Main.onEnable(Main.java:10) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.v1_4_6.CraftServer.loadPlugin(CraftServer.java:278) at org.bukkit.craftbukkit.v1_4_6.CraftServer.enablePlugins(CraftServer.java:260) at net.minecraft.server.v1_4_6.MinecraftServer.j(MinecraftServer.java:321) at net.minecraft.server.v1_4_6.MinecraftServer.e(MinecraftServer.java:300) at net.minecraft.server.v1_4_6.MinecraftServer.a(MinecraftServer.java:259) at net.minecraft.server.v1_4_6.DedicatedServer.init(DedicatedServer.java:149) at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:399) at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
it would be a lot easier debugging if we see the error you're getting, because we then can see what has gone wrong and where
Durp i forgot adding right now Added EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Your IDE should be able to help you a lot with those ;3. Just fix the red wriggly lines, and if you don't know how to fix a specific problem, post it here (including the line, additional snippets, and what your IDE is complaining about)
You take photos with cameras. Have you tried using the print screen key to capture a screen shot into the clipboard?
after you do print screen, it saves to your 'clipboard' best way to do it now is to go into MSPAINT and type "ctrl+v" to paste it, then save it wherever you want it
I like how this went off topic lol im going to take a pic of eclips now Um how do i show what line number its on and in code how do i put java on help ImDeJay EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Here the phto i under line what wrong its in the LIB and fireblast709 Bump EDIT by Moderator: merged posts, please use the edit button instead of double posting.
wait 12 hours before bumping a thread. but your error lies in a failure to copy/paste. the above picture tells me this: 1. You dont know much about Java. 2. Your expecting someone else to code your plugin for you. the and should not be there. that was put there by the forums [ syntax] command. Remove the and . ps. if your going to copy/paste code atleast know what it does so you can fix problems like this instead of just copy/pasting an entire project together then calling it your own.
I know a lot about java at last how to code a program so stop dising me Ok i got it how do i mark it solve? EDIT by Moderator: merged posts, please use the edit button instead of double posting.