Merge pull request #135 from amousset/master
Add redirection for index page
This commit is contained in:
@@ -1,57 +1 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="js csstransforms3d">
|
||||
<head>
|
||||
<meta name="generator" content="Hugo 0.20.7" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
|
||||
|
||||
|
||||
<title>Lettre site</title>
|
||||
|
||||
|
||||
<link href="https://lettre.github.io/lettre//css/nucleus.css" rel="stylesheet">
|
||||
<link href="https://lettre.github.io/lettre//css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="https://lettre.github.io/lettre//css/hybrid.css" rel="stylesheet">
|
||||
<link href="https://lettre.github.io/lettre//css/featherlight.min.css" rel="stylesheet">
|
||||
<link href="https://lettre.github.io/lettre//css/perfect-scrollbar.min.css" rel="stylesheet">
|
||||
<link href="https://lettre.github.io/lettre//css/theme.css" rel="stylesheet">
|
||||
<link href="https://lettre.github.io/lettre//css/hugo-theme.css" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
:root #header + #content > #left > #rlblock_left {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
p,li,ul {
|
||||
text-align: center
|
||||
}
|
||||
|
||||
ul
|
||||
{
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<body class="" data-url="/">
|
||||
|
||||
<section id="body" style="margin-left:0px;">
|
||||
<div id="overlay"></div>
|
||||
|
||||
<div class="padding highlightable">
|
||||
<h1>Customize your own home page</h1>
|
||||
<p>
|
||||
The site is working, change the URL in your browser to get to any custom page. But, don't forget to <a href="https://gohugo.io/themes/customizing/">overwrite this index.html</a> with your own. You typically have 3 choices :
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>1. </b> Create an overview page for your project</li>
|
||||
<li><b>2. </b> Create an empty html page with this code in the head tag to redirect to one of your documentation page : <code><meta http-equiv="refresh" content="0; url=http://example.com/"/></code> </li>
|
||||
<li><b>3. </b> Configure your server to automatically redirect home page to one your documentation page</li>
|
||||
</ul>
|
||||
<p><i class="fa fa-heart fa-4x"></i></p>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
<meta http-equiv="refresh" content="0; url=https://lettre.github.io/lettre/getting-started/intro/"/>
|
||||
|
||||
@@ -265,7 +265,6 @@
|
||||
<p>The file transport writes the emails to the given directory. The name of the file will be
|
||||
<code>message_id.txt</code>.
|
||||
It can be useful for testing purposes, or if you want to keep track of sent messages.</p>
|
||||
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> std</span>::<span style="color: #f8f8f2">env</span>::<span style="color: #f8f8f2">temp_dir;</span>
|
||||
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">file</span>::<span style="color: #f8f8f2">FileEmailTransport;</span>
|
||||
@@ -284,10 +283,8 @@ It can be useful for testing purposes, or if you want to keep track of sent mess
|
||||
<span style="color: #f8f8f2">assert</span><span style="color: #f92672">!</span><span style="color: #f8f8f2">(result.is_ok());</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Example result in <code>/tmp/b7c211bc-9811-45ce-8cd9-68eab575d695.txt</code>:</p>
|
||||
|
||||
<pre><code class="language-text">b7c211bc-9811-45ce-8cd9-68eab575d695: from=<user@localhost> to=<root@localhost>
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>b7c211bc-9811-45ce-8cd9-68eab575d695: from=<user@localhost> to=<root@localhost>
|
||||
To: <root@localhost>
|
||||
From: <user@localhost>
|
||||
Subject: Hello
|
||||
@@ -295,7 +292,7 @@ Date: Sat, 31 Oct 2015 13:42:19 +0100
|
||||
Message-ID: <b7c211bc-9811-45ce-8cd9-68eab575d695.lettre@localhost>
|
||||
|
||||
Hello World!
|
||||
</code></pre>
|
||||
</pre></div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -263,7 +263,6 @@
|
||||
|
||||
|
||||
<p>The sendmail transport sends the email using the local sendmail command.</p>
|
||||
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">sendmail</span>::<span style="color: #f8f8f2">SendmailTransport;</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">{SimpleSendableEmail, EmailTransport};</span>
|
||||
|
||||
@@ -280,7 +279,6 @@
|
||||
</pre></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -297,7 +297,6 @@ emails directly to the destination.</p>
|
||||
<h4 id="simple-example">Simple example</h4>
|
||||
|
||||
<p>This is the most basic example of usage:</p>
|
||||
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">{SimpleSendableEmail, EmailTransport};</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">SmtpTransportBuilder;</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">SecurityLevel;</span>
|
||||
@@ -318,10 +317,8 @@ emails directly to the destination.</p>
|
||||
<span style="color: #f8f8f2">assert</span><span style="color: #f92672">!</span><span style="color: #f8f8f2">(result.is_ok());</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h4 id="complete-example">Complete example</h4>
|
||||
|
||||
<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">{SecurityLevel, SmtpTransport,</span>
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">{SecurityLevel, SmtpTransport,</span>
|
||||
<span style="color: #f8f8f2">SmtpTransportBuilder};</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">authentication</span>::<span style="color: #f8f8f2">Mechanism;</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">SUBMISSION_PORT;</span>
|
||||
@@ -361,14 +358,12 @@ emails directly to the destination.</p>
|
||||
<span style="color: #75715e">// Explicitly close the SMTP transaction as we enabled connection reuse</span>
|
||||
<span style="color: #f8f8f2">mailer.close();</span>
|
||||
</pre></div>
|
||||
</p>
|
||||
|
||||
<h4 id="lower-level">Lower level</h4>
|
||||
|
||||
<p>You can also send commands, here is a simple email transaction without
|
||||
error handling:</p>
|
||||
|
||||
<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">SMTP_PORT;</span>
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">SMTP_PORT;</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">client</span>::<span style="color: #f8f8f2">Client;</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">smtp</span>::<span style="color: #f8f8f2">client</span>::<span style="color: #f8f8f2">net</span>::<span style="color: #f8f8f2">NetworkStream;</span>
|
||||
|
||||
@@ -381,7 +376,6 @@ error handling:</p>
|
||||
<span style="color: #66d9ef">let</span><span style="color: #f8f8f2"> _ </span><span style="color: #f92672">=</span><span style="color: #f8f8f2"> email_client.message(</span><span style="color: #e6db74">"Test email"</span><span style="color: #f8f8f2">);</span>
|
||||
<span style="color: #66d9ef">let</span><span style="color: #f8f8f2"> _ </span><span style="color: #f92672">=</span><span style="color: #f8f8f2"> email_client.quit();</span>
|
||||
</pre></div>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -264,7 +264,6 @@
|
||||
|
||||
<p>The stub transport only logs message envelope and drops the content. It can be useful for
|
||||
testing purposes.</p>
|
||||
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">stub</span>::<span style="color: #f8f8f2">StubEmailTransport;</span>
|
||||
<span style="color: #66d9ef">use</span><span style="color: #f8f8f2"> lettre</span>::<span style="color: #f8f8f2">{SimpleSendableEmail, EmailTransport};</span>
|
||||
|
||||
@@ -280,11 +279,9 @@ testing purposes.</p>
|
||||
<span style="color: #f8f8f2">assert</span><span style="color: #f92672">!</span><span style="color: #f8f8f2">(result.is_ok());</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Will log the line:</p>
|
||||
|
||||
<pre><code class="language-text">b7c211bc-9811-45ce-8cd9-68eab575d695: from=<user@localhost> to=<root@localhost>
|
||||
</code></pre>
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>b7c211bc-9811-45ce-8cd9-68eab575d695: from=<user@localhost> to=<root@localhost>
|
||||
</pre></div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
[
|
||||
{
|
||||
"uri": "/content/basics/_index",
|
||||
"title": "Some Chapter title",
|
||||
"content": "\nChapter X\n\n Some Chapter title\n\nLorem ipsum\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/basics/first-content",
|
||||
"title": "Some Title",
|
||||
"content": "\nLorem Ipsum\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/creating-messages/_index",
|
||||
"title": "Creating messages",
|
||||
"content": "\nCreating messages\n\n test2\n\nLorem ipsum\n",
|
||||
"content": "\nCreating messages\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/creating-messages/first-content",
|
||||
"title": "Some Title",
|
||||
"content": "\nLorem Ipsum\n",
|
||||
"uri": "/content/getting-started/_index",
|
||||
"title": "Getting started",
|
||||
"content": "\nGetting started\n\nThis section explains how to manipulate emails you have created.",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/getting-started/intro",
|
||||
"title": "Introduction",
|
||||
"content": "\nLettre is an email library that allows creating and sending messages. It provides:\n\nAn easy to use email builder\nPluggable email transports\nUnicode support (for emails and transports, including for sender et recipient addresses when compatible)\nSecure defaults (emails are only sent encrypted by default)\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/sending-messages/_index",
|
||||
"title": "Sending messages",
|
||||
"content": "\nSending messages\n\n test\n\nLorem ipsum\n",
|
||||
"content": "\nSending Messages\n\nThis section explains how to manipulate emails you have created.",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/sending-messages/file",
|
||||
"title": "File transport",
|
||||
"content": "\nLorem Ipsum\n",
|
||||
"content": "\nThe file transport writes the emails to the given directory. The name of the file will be\nmessage_id.txt.\nIt can be useful for testing purposes, or if you want to keep track of sent messages.\n\nuse std::env::temp_dir;\n\nuse lettre::file::FileEmailTransport;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\n// Write to the local temp directory\nlet mut sender = FileEmailTransport::new(temp_dir());\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\nlet result = sender.send(email);\nassert!(result.is_ok());\n\nExample result in /tmp/b7c211bc-9811-45ce-8cd9-68eab575d695.txt:\n\nb7c211bc-9811-45ce-8cd9-68eab575d695: from=user@localhost to=root@localhost\nTo: root@localhost\nFrom: user@localhost\nSubject: Hello\nDate: Sat, 31 Oct 2015 13:42:19 +0100\nMessage-ID: b7c211bc-9811-45ce-8cd9-68eab575d695.lettre@localhost\n\nHello World!\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/sending-messages/intro",
|
||||
"title": "Introduction",
|
||||
"content": "\nThis mailer contains several different transports for your emails. To be sendable, the\nemails have to implement SendableEmail, which is the case for emails created with lettre_email.\n\nThe following transports are available:\n\nThe SmtpTransport uses the SMTP protocol to send the message over the network. It is\n the prefered way of sending emails.\nThe SendmailTransport uses the sendmail command to send messages. It is an alternative to\n the SMTP transport.\nThe FileTransport creates a file containing the email content to be sent. It can be used\n for debugging or if you want to keep all sent emails.\nThe StubTransport is useful for debugging, and only prints the content of the email in the\n logs.\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/sending-messages/sendmail",
|
||||
"title": "Sendmail transport",
|
||||
"content": "\nLorem Ipsum\n",
|
||||
"content": "\nThe sendmail transport sends the email using the local sendmail command.\n\nuse lettre::sendmail::SendmailTransport;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\nlet mut sender = SendmailTransport::new();\nlet result = sender.send(email);\nassert!(result.is_ok());\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/sending-messages/smtp",
|
||||
"title": "SMTP transport",
|
||||
"content": "\nThis transport uses the SMTP protocol to send emails over the network (locally or remotely).\n\nIt is desinged to be:\n\nSecured: email are encrypted by default\nModern: Unicode support for email content and sender/recipient adresses when compatible\nFast: supports tcp connection reuse\n\nThis client is designed to send emails to a relay server, and should not be used to send\nemails directly to the destination.\n\nThe relay server can be the local email server, a specific host or a third-party service.\n\nSimple example\n\nThis is the most basic example of usage:\n\n{{ highlight rust }}\nuse lettre::{SimpleSendableEmail, EmailTransport};\nuse lettre::smtp::SmtpTransportBuilder;\nuse lettre::smtp::SecurityLevel;\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Open a local connection on port 25\nlet mut mailer =\nSmtpTransportBuilder::localhost().unwrap().security_level(SecurityLevel::Opportunistic).build();\n// Send the email\nlet result = mailer.send(email);\n\nassert!(result.is_ok());\n{{ /highlight }}\n\n Complete example\n\n{{ highlight rust }}\nuse lettre::smtp::{SecurityLevel, SmtpTransport,\nSmtpTransportBuilder};\nuse lettre::smtp::authentication::Mechanism;\nuse lettre::smtp::SUBMISSION_PORT;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Connect to a remote server on a custom port\nlet mut mailer = SmtpTransportBuilder::new((\"server.tld\",\nSUBMISSION_PORT)).unwrap()\n // Set the name sent during EHLO/HELO, default is localhost\n .hello_name(\"my.hostname.tld\")\n // Add credentials for authentication\n .credentials(\"username\", \"password\")\n // Specify a TLS security level. You can also specify an SslContext with\n // .ssl_context(SslContext::Ssl23)\n .security_level(SecurityLevel::AlwaysEncrypt)\n // Enable SMTPUTF8 if the server supports it\n .smtp_utf8(true)\n // Configure expected authentication mechanism\n .authentication_mechanism(Mechanism::CramMd5)\n // Enable connection reuse\n .connection_reuse(true).build();\n\nlet result_1 = mailer.send(email.clone());\nassert!(result1.isok());\n\n// The second email will use the same connection\nlet result_2 = mailer.send(email);\nassert!(result2.isok());\n\n// Explicitly close the SMTP transaction as we enabled connection reuse\nmailer.close();\n{{ /highlight }}\n\nLower level\n\nYou can also send commands, here is a simple email transaction without\nerror handling:\n\n{{ highlight rust }}\nuse lettre::smtp::SMTP_PORT;\nuse lettre::smtp::client::Client;\nuse lettre::smtp::client::net::NetworkStream;\n\nlet mut email_client: ClientNetworkStream = Client::new();\nlet _ = emailclient.connect(&(\"localhost\", SMTPPORT), None);\nlet _ = emailclient.ehlo(\"myhostname\");\nlet _ = email_client.mail(\"user@example.com\", None);\nlet _ = email_client.rcpt(\"user@example.org\");\nlet _ = email_client.data();\nlet _ = email_client.message(\"Test email\");\nlet _ = email_client.quit();\n{{ /highlight }}\n\n",
|
||||
"content": "\nThis transport uses the SMTP protocol to send emails over the network (locally or remotely).\n\nIt is desinged to be:\n\nSecured: email are encrypted by default\nModern: Unicode support for email content and sender/recipient adresses when compatible\nFast: supports tcp connection reuse\n\nThis client is designed to send emails to a relay server, and should not be used to send\nemails directly to the destination.\n\nThe relay server can be the local email server, a specific host or a third-party service.\n\nSimple example\n\nThis is the most basic example of usage:\n\nuse lettre::{SimpleSendableEmail, EmailTransport};\nuse lettre::smtp::SmtpTransportBuilder;\nuse lettre::smtp::SecurityLevel;\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Open a local connection on port 25\nlet mut mailer =\nSmtpTransportBuilder::localhost().unwrap().security_level(SecurityLevel::Opportunistic).build();\n// Send the email\nlet result = mailer.send(email);\n\nassert!(result.is_ok());\n\n Complete example\n\nuse lettre::smtp::{SecurityLevel, SmtpTransport,\nSmtpTransportBuilder};\nuse lettre::smtp::authentication::Mechanism;\nuse lettre::smtp::SUBMISSION_PORT;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Connect to a remote server on a custom port\nlet mut mailer = SmtpTransportBuilder::new((\"server.tld\",\nSUBMISSION_PORT)).unwrap()\n // Set the name sent during EHLO/HELO, default is localhost\n .hello_name(\"my.hostname.tld\")\n // Add credentials for authentication\n .credentials(\"username\", \"password\")\n // Specify a TLS security level. You can also specify an SslContext with\n // .ssl_context(SslContext::Ssl23)\n .security_level(SecurityLevel::AlwaysEncrypt)\n // Enable SMTPUTF8 if the server supports it\n .smtp_utf8(true)\n // Configure expected authentication mechanism\n .authentication_mechanism(Mechanism::CramMd5)\n // Enable connection reuse\n .connection_reuse(true).build();\n\nlet result_1 = mailer.send(email.clone());\nassert!(result1.isok());\n\n// The second email will use the same connection\nlet result_2 = mailer.send(email);\nassert!(result2.isok());\n\n// Explicitly close the SMTP transaction as we enabled connection reuse\nmailer.close();\n\nLower level\n\nYou can also send commands, here is a simple email transaction without\nerror handling:\n\nuse lettre::smtp::SMTP_PORT;\nuse lettre::smtp::client::Client;\nuse lettre::smtp::client::net::NetworkStream;\n\nlet mut email_client: ClientNetworkStream = Client::new();\nlet _ = emailclient.connect(&(\"localhost\", SMTPPORT), None);\nlet _ = emailclient.ehlo(\"myhostname\");\nlet _ = email_client.mail(\"user@example.com\", None);\nlet _ = email_client.rcpt(\"user@example.org\");\nlet _ = email_client.data();\nlet _ = email_client.message(\"Test email\");\nlet _ = email_client.quit();\n\n",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"uri": "/content/sending-messages/stub",
|
||||
"title": "Stub transport",
|
||||
"content": "\nLorem Ipsum\n",
|
||||
"content": "\nThe stub transport only logs message envelope and drops the content. It can be useful for\ntesting purposes.\n\nuse lettre::stub::StubEmailTransport;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\nlet mut sender = StubEmailTransport;\nlet result = sender.send(email);\nassert!(result.is_ok());\n\nWill log the line:\n\nb7c211bc-9811-45ce-8cd9-68eab575d695: from=user@localhost to=root@localhost\n`",
|
||||
"tags": []
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user