测试测试过 | ✗ |
语言语言 | Obj-CObjective C |
许可 | MIT |
发布最后发布 | 2014年12月 |
由Kunal Batra 和 Heitor Tashiro Sergent 维护。
此模块将使您能够以简单的方式构建 SendGrid 的 SMTP API 标头。
选择您的安装方法 - CocoaPods(推荐)或通过源代码。
platform :ios, '7.0'
pod 'smtpapi', '~> 0.1.0'
在命令行中运行以下命令
pod install
请确保现在打开 xcworkspace 文件而不是 xcodeproj 文件。
然后导入库 - 在适合您项目的文件中。
import <SMTPAPI/SMTPAPI.h>
通过源代码安装
1. Clone this repository.
2. Copy SMTPAPI.h and .m files to your project.
3. Import SMTPAPI.h in the file appropriate to your project.
import <SMTPAPI/SMTPAPI.h>
SMTPAPI *header = [SMTPAPI alloc] init];
[header addTo:@"[email protected]"];
// or
[header addTo:@[@"[email protected]"];
// or
[header setTos:@[@"[email protected]"]];
NSArray *tos = [header getTos];
[header addSubstitution:@"key" val:@"value"];
NSMutableDictionary *subs = [header getSubstitutions];
[header addUniqueArg:@"key" val:@"value"];
// or
NSMutableDictionary *uniqueArgs = [[NSMutableDictionary alloc] init];
[uniqueArgs setObject:@"value" forKey:@"unique"];
[header setUniqueArgs:uniqueArgs];
NSMutableDictionary *args = [header getUniqueArgs];
[header addCategory:@"category"];
// or
[header addCategories:@[@"category1", @"category2"]];
// or
[header setCategories:@[@"category1", @"category2"]];
NSMutableArray *cats = [header getCategories];
[header addSection:@"key" val:@"section"];
// or
NSMutableDictionary *newSec = [[NSMutableDictionary alloc] init];
[newSec setObject:@"value" forKey:@"-section-"];
[header setSections:newSec];
NSMutableDictionary *sections = [header getSections];
[header addFilter:@"filter" setting:@"setting" val:@"value"];
[header addFilter:@"filter" settings:@"setting" val:1];
NSMutableDictionary *filters = [header getFilters];
[header configureHeader];
NSString *headers = header.encodedHeader;
基于 MIT 许可证。