update README
This commit is contained in:
		
							parent
							
								
									3c4b740849
								
							
						
					
					
						commit
						dd9018bcef
					
				
							
								
								
									
										15
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								README.md
									
									
									
									
									
								
							| @ -3,7 +3,7 @@ A little service to send e-mail. | ||||
| 
 | ||||
| ## Build | ||||
| ```bash | ||||
| make | ||||
| make build | ||||
| ``` | ||||
| 
 | ||||
| ## Configuration | ||||
| @ -25,15 +25,22 @@ outbox_path = "<dir_path>" # directory used to retrieve `.json` e-mail format to | ||||
| ``` | ||||
| 
 | ||||
| ## How to send a mail ? | ||||
| ### JSON file | ||||
| * create a JSON file like: | ||||
| ```json | ||||
| { | ||||
|         "sender":"<email>", | ||||
|         "receivers": ["<email_1>","<email_2>", ..., "<email_n>"], | ||||
|         "receivers": "<email_1>,<email_2>, ..., <email_n>", | ||||
|         "subject": "<subject>", | ||||
|         "content": "<mail_content>" | ||||
| } | ||||
| ``` | ||||
| * put the JSON file in the `outbox` directory define in the `.ini` file | ||||
| * put the JSON file in the `outbox` directory defined in the `.ini` file. | ||||
| 
 | ||||
| **NOTE**: HTML is interpreted for the e-mail content | ||||
| ### HTTP | ||||
| An http server is embedded inside `mailsrv` and is listening on port **1212**. To send an email you can post a JSON to **/mail**: | ||||
| ``` | ||||
| curl http://localhost:1212/mail -d '{"sender":"test@test.com","receivers":"test1@test.com,test2@test.com","subject":"test","content":"<h1>test</h1>"}' | ||||
| ``` | ||||
| 
 | ||||
| **NOTE**: HTML is interpreted for the e-mail content. | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user