aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llmail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llmail.cpp')
-rw-r--r--linden/indra/llmessage/llmail.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/linden/indra/llmessage/llmail.cpp b/linden/indra/llmessage/llmail.cpp
index 8ae7206..0504080 100644
--- a/linden/indra/llmessage/llmail.cpp
+++ b/linden/indra/llmessage/llmail.cpp
@@ -51,6 +51,7 @@
51#include "llblowfishcipher.h" 51#include "llblowfishcipher.h"
52#include "llerror.h" 52#include "llerror.h"
53#include "llhost.h" 53#include "llhost.h"
54#include "llsd.h"
54#include "llstring.h" 55#include "llstring.h"
55#include "lluuid.h" 56#include "lluuid.h"
56#include "net.h" 57#include "net.h"
@@ -111,16 +112,22 @@ void disconnect_smtp()
111// Returns TRUE on success. 112// Returns TRUE on success.
112// message should NOT be SMTP escaped. 113// message should NOT be SMTP escaped.
113// static 114// static
114BOOL LLMail::send(const char* from_name, const char* from_address, 115BOOL LLMail::send(
115 const char* to_name, const char* to_address, 116 const char* from_name,
116 const char* subject, const char* message) 117 const char* from_address,
118 const char* to_name,
119 const char* to_address,
120 const char* subject,
121 const char* message,
122 const LLSD& headers)
117{ 123{
118 std::string header = buildSMTPTransaction( 124 std::string header = buildSMTPTransaction(
119 from_name, 125 from_name,
120 from_address, 126 from_address,
121 to_name, 127 to_name,
122 to_address, 128 to_address,
123 subject); 129 subject,
130 headers);
124 if(header.empty()) 131 if(header.empty())
125 { 132 {
126 return FALSE; 133 return FALSE;
@@ -192,7 +199,8 @@ std::string LLMail::buildSMTPTransaction(
192 const char* from_address, 199 const char* from_address,
193 const char* to_name, 200 const char* to_name,
194 const char* to_address, 201 const char* to_address,
195 const char* subject) 202 const char* subject,
203 const LLSD& headers)
196{ 204{
197 if(!from_address || !to_address) 205 if(!from_address || !to_address)
198 { 206 {
@@ -236,8 +244,20 @@ std::string LLMail::buildSMTPTransaction(
236 << "DATA\r\n" 244 << "DATA\r\n"
237 << "From: " << from_fmt.str() << "\r\n" 245 << "From: " << from_fmt.str() << "\r\n"
238 << "To: " << to_fmt.str() << "\r\n" 246 << "To: " << to_fmt.str() << "\r\n"
239 << "Subject: " << subject << "\r\n" 247 << "Subject: " << subject << "\r\n";
240 << "\r\n"; 248
249 if(headers.isMap())
250 {
251 LLSD::map_const_iterator iter = headers.beginMap();
252 LLSD::map_const_iterator end = headers.endMap();
253 for(; iter != end; ++iter)
254 {
255 header << (*iter).first << ": " << ((*iter).second).asString()
256 << "\r\n";
257 }
258 }
259
260 header << "\r\n";
241 return header.str(); 261 return header.str();
242} 262}
243 263