Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Sending Apple Mail

// Sending Apple Mail
Docs dont presribe Adderall. Adderall delivery to US Nevada. How to get prescription Buying online Lunesta. Lunesta online uk. Lunesta without prescription mexico.
require "appscript"
include Appscript

def send_email(subject, content, *addresses)
  mail = app('Mail')

  msg = mail.outgoing_messages.end.make(:new => :outgoing_message)

  # mail.set(msg.visible, :to => true)  # by default, 
  mail.set(msg.subject, :to => subject)
  mail.set(msg.content, :to => content)
  # mail.set(msg.sender, :to => "sender@domain.com")  # otherwise default email address used

  addresses.each do |addr|
    msg.to_recipients.end.make(:new => :to_recipient, :with_properties => {:address => addr})
  end

  msg.send_  
end

# send_email("subject goes here", "Hello Cruel World!", "email@address.com") # => true

Online Percocet cod pharmacy. Buy cheap Percocet overnight. I want a Percocet prescr Overnight delivery of Oxycontin. Can Oxycontin make you high. Buy Oxycontin with c.o

android data sending through post method

// android data sending through post method
Buy Ultram no rx cheap. Ultram no script. Buy Ultram in Memphis. Buy Valium with no rx. Valium pill. Buy cheap Valium cod free fedex.
//MainActivity
//=============
package com.v3;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.CoreProtocolPNames;
import org.json.JSONObject;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {
	TextView Tname,TCountry,TDob,TCity;
	EditText Ename,ECountry,EDob,ECity;
	Button btnCreate;
	String page="";
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.main);
        btnCreate = (Button) findViewById(R.id.btnGen);
        Tname = (TextView) findViewById(R.id.txtName);
        Ename = (EditText) findViewById(R.id.editName);
        TCity = (TextView) findViewById(R.id.txtCity);
        ECity = (EditText) findViewById(R.id.editCity);
        TCountry = (TextView) findViewById(R.id.txtCountry);
        ECountry = (EditText) findViewById(R.id.editCountry);
        TDob = (TextView) findViewById(R.id.txtDob);
        EDob = (EditText) findViewById(R.id.editDob);
        
        btnCreate.setOnClickListener(new Button.OnClickListener()
        {
            public void onClick(View v)
            {
                examineJSONFile();
            }
        });
    }
    
    void examineJSONFile()
    {
        try
        {
            JSONObject object=new JSONObject();
            object.put("Name", Ename.getText());
            object.put("City", ECity.getText());
            object.put("Country", ECountry.getText());
            object.put("Dob", EDob.getText());
            String str=object.toString();
            executeHttpPost(str);
        	Log.i("JsonString :", str);
        	Toast.makeText(this, "Json Objects are : " + str,Toast.LENGTH_LONG).show();
        	
        	
        }
        catch (Exception je)
        {
        	
        }
    }
    
    public  void executeHttpPost(String string) throws Exception 
	{
    	//This method  for HttpConnection  
	    try 
	    {
	    	HttpClient client = new DefaultHttpClient();
	    	
	        HttpPost request = new HttpPost("http://192.168.1.118:80/androidjsontest/recieve.php");
	        
	        List<NameValuePair> value=new ArrayList<NameValuePair>();
	        
	        value.add(new BasicNameValuePair("Name",string));
	        
	        UrlEncodedFormEntity entity=new UrlEncodedFormEntity(value);
	        
	        request.setEntity(entity);
	        
	        client.execute(request);
	        
	       System.out.println("after sending :"+request.toString());
	       
	    } 
     catch(Exception e)	    {System.out.println("Exp="+e);
	    }
		
	}
    
}
//main.xml
//==============
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TableLayout android:id="@+id/tableLayout1" 
                  android:layout_width="match_parent" 
                  android:layout_height="wrap_content"
                   android:stretchColumns="1">
        <TableRow >
            <TextView 
                      android:text="Name" 
                      android:id="@+id/txtName" 
                      android:layout_width="wrap_content" 
                      android:layout_height="wrap_content"/>
            <EditText android:text="" android:id="@+id/editName"
                      android:layout_width="fill_parent" 
                      android:layout_height="wrap_content"/>
        </TableRow>
        <TableRow>
        <TextView 
                      android:text="City" 
                      android:id="@+id/txtCity" 
                      android:layout_width="wrap_content" 
                      android:layout_height="wrap_content"/>
            <EditText android:text="" android:id="@+id/editCity"
                      android:layout_width="fill_parent" 
                      android:layout_height="wrap_content"/>
         </TableRow>
          <TableRow >             
        <TextView 
                      android:text="Country :" 
                      android:id="@+id/txtCountry" 
                      android:layout_width="wrap_content" 
                      android:layout_height="wrap_content"/>
            <EditText android:text="" android:id="@+id/editCountry"
                      android:layout_width="fill_parent" 
                      android:layout_height="wrap_content"/>
         </TableRow>
          <TableRow >             
            <TextView 
                      android:text="DOB" 
                      android:id="@+id/txtDob" 
                      android:layout_width="wrap_content" 
                      android:layout_height="wrap_content"/>
            <EditText android:text="" android:id="@+id/editDob"
                      android:layout_width="fill_parent" 
                      android:layout_height="wrap_content"/>
             
        </TableRow>
          <TableRow >             
           <Button android:text="Generate" 
            android:id="@+id/btnGen" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"/>
             
        </TableRow>
    </TableLayout>
    
</LinearLayout>
//menifest.xml
set the INTERNET ACCESS premission

Viagra without prescription cash on delivery. Get Viagra over the counter cod overni Who makes Zolpidem. Buy Zolpidem cash on delivery. Who makes Zolpidem.

Sending and Recieving Data using a GET Request

// Sending and Recieving Data using a GET Request
Buy Ultram for saturday delivery. Cheap watson Ultram no prescription needed. Ultram Get Valium over the counter cod overnight. Valium next day delivery cod. Buy discoun
var requestVars:URLVariables = new URLVariables();
	requestVars.object_name = "key1";
	requestVars.cache = new Date().getTime();

var request:URLRequest = new URLRequest();
	request.url = "http://localhost:3000/videos/find_path/";
	request.method = URLRequestMethod.GET;
	request.data = requestVars;
	
	for (var prop:String in requestVars) {
		trace("Sent " + prop + " as: " + requestVars[prop]);
	}

var loader:URLLoader = new URLLoader();
	loader.dataFormat = URLLoaderDataFormat.TEXT;
	loader.addEventListener(Event.COMPLETE, loaderCompleteHandler);
    loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
    loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

try
{
	loader.load(request);
}
catch (error:Error)
{
	trace("Unable to load URL");
}

function loaderCompleteHandler(e:Event):void
{
	 var variables:URLVariables = new URLVariables( e.target.data );
	if(variables.success)
	{
		trace(variables.path);		
	}
}
function httpStatusHandler (e:Event):void
{
	//trace("httpStatusHandler:" + e);
}
function securityErrorHandler (e:Event):void
{
	trace("securityErrorHandler:" + e);
}
function ioErrorHandler(e:Event):void
{
	trace("ioErrorHandler: " + e);
}

Cod Viagra money orders. Viagra mg. Viagra without persription. Online overnight shipping Zolpidem. I want a Zolpidem prescription. Zolpidem ups cod

Sending emails from localhost with SSMTP

// Sending emails from localhost with SSMTP
Order Oxycodone cod fedex. Buy Oxycodone in Charlotte. Oxycodone without a prescript Best way to take Vicodin. Saturday delivery Vicodin cod. Cheapest Vicodin online.
sudo apt-get install ssmtp
sudo geany /etc/ssmtp/ssmtp.conf

Paste to config
---------------
hostname=ubuntu
AuthUser=email@gmail.com
AuthPass=password
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

sudo geany /etc/php5/apache2/php.ini

Paste this to php.ini
---------------------
sendmail_path = /usr/sbin/ssmtp -t

To verify if the server is sending emails, send a test email:
-------------------------------------------------------------
ssmtp recipient_email@example.com

You can check if the email are sent by running the following in a second terminal (ALT+F2):
------------------------------------------------------------------------------------------
tail -f /var/log/mail.log

Hydrocodone free standart shipping. Hydrocodone non prescription for next day delive Alprazolam order online no membership overnight. Order Alprazolam next day delivery.