This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // first add the header of the CSV file. The CSV file needs to be in the same place as this PHP script | |
| $header = "email" . "\n"; | |
| file_put_contents('filename.csv', $header, FILE_APPEND); // this is the command that adds the info from the $header variable on a line | |
| //in the below example the script adds 1.000.000 addresses in the CSV, one on each line | |
| for ($i=1; $i <=1000000; $i++) | |
| { | |
| $string = $i . "[email protected]\n"; //the address is built by concatenating the value of the variable | |
| // "i" to the rest of the email address. At the end we add \n to jump on a | |
| //new line so that the next address will be added on a new line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'httparty' | |
| require 'csv' | |
| url = 'https://api.sendgrid.com/api/unsubscribes.add.json' | |
| username = 'sg_username' | |
| password = 'sg_passwd' | |
| arr_of_addresses = [] | |
| # Opens the CSV from where you'll add the addresses to unsubscribe list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $url = 'https://api.sendgrid.com/'; | |
| $user = 'SG_username'; | |
| $pass = 'SG_password'; | |
| $params = array( | |
| 'api_user' => $user, | |
| 'api_key' => $pass, | |
| 'task' => 'get', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dim reportName As String | |
| Dim path As String | |
| Dim fso As Object | |
| Set fso = CreateObject("Scripting.FileSystemObject") | |
| Dim oFile As Object | |
| Dim strAttachments As String | |
| Dim strTransPort As String | |
| Dim byteData() As Byte | |
| Dim xmlhttp As Object | |
| Dim eTo As String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global class SendGrid { | |
| private static final String ENCODING = 'UTF-8'; | |
| private static final String API_URL = 'https://api.sendgrid.com/api/mail.send.json'; | |
| private transient String username; | |
| private transient String password; | |
| private transient String apikey; | |
| private enum AUTHTYPE {KEY, USER_PASS} | |
| private AUTHTYPE selAuthType; | |