Asp.net Gmail Üzerinden Mail Gönderme

Bu yazıda asp.net (c#) gmail hesabınız üzerinden mail gönderme işlemini yapacağız. Gmail smtp üzerinden, gmail hesabınızın mail ve şifre bilgilerini girerek istediğiniz mail adresine mail gönderebilirsiniz. Temel bilgiler olup toplu mail ve birden fazla dosya eki eklemekte mümkündür. (yaratıcılığınıza kalmış 🙂 )
Html kodları

<table style="background-color: #ffd800; padding: 10px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tdsol">Gönderilecek Email: </td>
<td><asp:TextBox ID="txtKime" runat="server"></asp:TextBox> </td>
</tr>
<tr>
<td class="tdsol">&nbsp; </td>
</tr>
<tr>
<td class="tdsol">Konu: </td>
<td><asp:TextBox ID="txtKonu" runat="server"></asp:TextBox> </td>
</tr>
<tr>
<td class="tdsol">&nbsp; </td>
</tr>
<tr>
<td valign="top" class="tdsol">Mesaj: </td>
<td><asp:TextBox ID="txtMesaj" runat="server" TextMode="MultiLine" Height="105px" Width="563px"></asp:TextBox> </td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>Mail Attachment: </td>
<td><asp:FileUpload ID="fuAttach" runat="server" /> </td>
</tr>
<tr> <td>&nbsp; </td> </tr>
<tr>
<td colspan="2"> <br /> Gmail Hesap Bilgileri<br /> <hr /> </td>
</tr>
<tr>
<td>Email: </td> <td> <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> </td>
</tr>
<tr>
<td>&nbsp; </td> </tr>
<tr>
<td>Şifre: </td> <td> <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox> </td>
</tr>
<tr>
<td>&nbsp; </td>
</tr>
<tr>
<td></td>
<td> <asp:Button ID="BtnGonder" Text=" Maili Gönder " runat="server" OnClick="BtnGonder_Click" /> </td>
</tr>
</table>
<table style="background-color: #ffd800; padding: 10px" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tdsol">Gönderilecek Email: </td> <td><asp:TextBox ID="txtKime" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="tdsol">&nbsp; </td> </tr> <tr> <td class="tdsol">Konu: </td> <td><asp:TextBox ID="txtKonu" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="tdsol">&nbsp; </td> </tr> <tr> <td valign="top" class="tdsol">Mesaj: </td> <td><asp:TextBox ID="txtMesaj" runat="server" TextMode="MultiLine" Height="105px" Width="563px"></asp:TextBox> </td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td>Mail Attachment: </td> <td><asp:FileUpload ID="fuAttach" runat="server" /> </td> </tr> <tr> <td>&nbsp; </td> </tr> <tr> <td colspan="2"> <br /> Gmail Hesap Bilgileri<br /> <hr /> </td> </tr> <tr> <td>Email: </td> <td> <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> </td> </tr> <tr> <td>&nbsp; </td> </tr> <tr> <td>Şifre: </td> <td> <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox> </td> </tr> <tr> <td>&nbsp; </td> </tr> <tr> <td></td> <td> <asp:Button ID="BtnGonder" Text=" Maili Gönder " runat="server" OnClick="BtnGonder_Click" /> </td> </tr> </table>
 <table style="background-color: #ffd800; padding: 10px" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="tdsol">Gönderilecek Email: </td>
                    <td><asp:TextBox ID="txtKime" runat="server"></asp:TextBox> </td>
                </tr>
                <tr>
                    <td class="tdsol">&nbsp; </td>
                </tr>
                <tr>
                    <td class="tdsol">Konu: </td>
                    <td><asp:TextBox ID="txtKonu" runat="server"></asp:TextBox> </td>
                </tr>
                <tr>
                    <td class="tdsol">&nbsp; </td>
                </tr>
                <tr>
                    <td valign="top" class="tdsol">Mesaj: </td>
                    <td><asp:TextBox ID="txtMesaj" runat="server" TextMode="MultiLine" Height="105px" Width="563px"></asp:TextBox> </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>Mail Attachment: </td>
                    <td><asp:FileUpload ID="fuAttach" runat="server" /> </td>
                </tr>
                <tr> <td>&nbsp; </td> </tr>
                <tr>
                    <td colspan="2"> <br /> Gmail Hesap Bilgileri<br /> <hr /> </td>
                </tr>
                <tr>
                    <td>Email: </td>  <td>  <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> </td>
                </tr>
                <tr>
                     <td>&nbsp; </td> </tr>
                <tr>
                    <td>Şifre: </td>  <td>  <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox> </td>
                </tr>
                <tr>
                    <td>&nbsp; </td>
                </tr>
                <tr>
                    <td></td>
                    <td> <asp:Button ID="BtnGonder" Text=" Maili Gönder " runat="server" OnClick="BtnGonder_Click" /> </td>
                </tr>
            </table>
Continue Reading