Questions tagged [smtp]

Simple Mail Transfer Protocol (SMTP) is an Internet standard for electronic mail (e-mail) transmission across Internet Protocol (IP) networks.

SMTP was first defined by RFC 821 (1982, eventually declared STD 10), and last updated by RFC 5321 (2008) which includes the extended SMTP (ESMTP) additions, and is the protocol in widespread use today. SMTP is specified for outgoing mail transport and uses TCP port 25. The protocol for new submissions is effectively the same as SMTP, but it uses port 587 instead. SMTP connections secured by SSL are known by the shorthand SMTPS, though SMTPS is not a protocol in its own right.

RFC 5321 governs the network protocol for transport of mail messages between servers. You might also want to look at RFC5322, which lays out the fundamental message format. Note that it has been extended by numerous additions, most notably the MIME facilities and various amendments for internationalization support.

While electronic mail servers and other mail transfer agents use SMTP to send and receive mail messages, user-level client mail applications typically only use SMTP for sending messages to a mail server for relaying. For receiving messages, client applications usually use either the Post Office Protocol (POP, ) or the Internet Message Access Protocol (IMAP, ) or a proprietary system (such as Microsoft Exchange or Lotus Notes/Domino) to access their mail box accounts on a mail server.

Useful links

10906 questions
143
votes
9 answers

Sending email with PHP from an SMTP server

$from = "someonelse@example.com"; $headers = "From:" . $from; echo mail ("borutflis1@gmail.com" ,"testmailfunction" , "Oj",$headers); I have trouble sending email in PHP. I get an error: SMTP server response: 530 SMTP authentication is required. I…
Borut Flis
  • 12,872
  • 26
  • 74
  • 102
135
votes
4 answers

How to check if smtp is working from commandline (Linux)

I have a SMTP-server, for the purpose of this question lets call it: smtp.mydomain.com. How do i check if the SMTP-server is in working? Can I send emails manually from Linux commandline?
balanv
  • 10,150
  • 25
  • 88
  • 134
130
votes
14 answers

How to check if an email address exists without sending an email?

I have come across this PHP code to check email address using SMTP without sending an email. Has anyone tried anything similar or does it work for you? Can you tell if an email customer / user enters is correct & exists?
php-guy
  • 1,303
  • 2
  • 9
  • 6
129
votes
25 answers

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required?

I want to send an email from my application and i have written following code for sending mail MailMessage msg = new MailMessage(); msg.From = new MailAddress("mymailid"); msg.To.Add("receipientid"); msg.Subject = "test"; …
Abhay Andhariya
  • 1,699
  • 3
  • 14
  • 23
129
votes
9 answers

How to develop and test an app that sends emails (without filling someone's mailbox with test data)?

I have a lot of apps that send email. Sometimes it's one or two messages at a time. Sometimes it's thousands of messages. In development, I usually test by substituting my own address for any recipient addresses. I'm sure that's what everybody else…
Patrick McElhaney
  • 52,844
  • 37
  • 123
  • 157
124
votes
11 answers

Outlook autocleaning my line breaks and screwing up my email format

I'm sending an email using the dotnet framework. Here is the template that I'm using to create the message: Date of Hire: %HireDate% Annual Salary: %AnnualIncome% Reason for Request: %ReasonForRequest% Name of Voluntary Employee: %FirstName%…
Aheho
  • 11,956
  • 13
  • 51
  • 76
122
votes
12 answers

Send inline image in email

Having an issue sending an image via email as an embedded image in the body. The image file shows as an attachment which is ok but the inline image portion just shows as a red x. Here is what I have so far LinkedResource inline = new…
Tsukasa
  • 5,812
  • 12
  • 53
  • 89
120
votes
14 answers

Sending mail from Python using SMTP

I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing ? from smtplib import SMTP import datetime debuglevel = 0 smtp =…
Eli Bendersky
  • 231,995
  • 78
  • 333
  • 394
120
votes
8 answers

Attach a file from MemoryStream to a MailMessage in C#

I am writing a program to attach a file to email. Currently I am saving file using FileStream into disk, and then I use System.Net.Mail.MailMessage.Attachments.Add( new System.Net.Mail.Attachment("file name")); I do not want to store file in…
Zain Ali
  • 13,997
  • 14
  • 87
  • 103
117
votes
9 answers

Sending email with attachments from C#, attachments arrive as Part 1.2 in Thunderbird

I have a C# application which emails out Excel spreadsheet reports via an Exchange 2007 server using SMTP. These arrive fine for Outlook users, but for Thunderbird and Blackberry users the attachments have been renamed as "Part 1.2". I found this…
Jon
  • 4,957
  • 5
  • 27
  • 38
112
votes
20 answers

SmtpException: Unable to read data from the transport connection: net_io_connectionclosed

I am using the SmtpClient library to send emails using the following: SmtpClient client = new SmtpClient(); client.Host = "hostname"; client.Port = 465; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials =…
Jake C
  • 3,502
  • 3
  • 16
  • 19
100
votes
2 answers

Sending email fails when two factor authentication is on for Gmail

I am using my Gmail account and smtp.gmail.com inside my web application to test and send email. when two factor authentication is ON for my Gmail account, it fails to send the email, however when I turn it off, the web application sends email…
user217648
  • 2,772
  • 7
  • 32
  • 53
97
votes
8 answers

Login credentials not working with Gmail SMTP

I am attempting to send an email in Python, through Gmail. Here is my code: import smtplib fromaddr = '......................' toaddrs = '......................' msg = 'Spam email Test' username = '.......' password = '.......' server =…
Jacob Kudria
  • 1,500
  • 2
  • 13
  • 17
96
votes
10 answers

Testing email sending in Django

I need to test that my Django application sends e-mails with correct content. I don't want to rely on external systems (like an ad-hoc gmail account), since I'm not testing the actual e-mail service... I would like to, maybe, store the emails…
RadiantHex
  • 22,589
  • 43
  • 141
  • 236
95
votes
12 answers

How to send email in ASP.NET C#

I'm very new to the ASP.NET C# area. I'm planning to send a mail through ASP.NET C# and this is the SMTP address from my ISP: smtp-proxy.tm.net.my Below is what I tried to do, but failed. <%@ Page Language="C#" AutoEventWireup="true"…
SuicideSheep
  • 4,542
  • 15
  • 54
  • 99