I am trying to create a portfolio website for a college class and want to sent up a contact page where people can sent me messages rather than just posting my personal email to the world.  the problem it, the mail keeps going to my junk folder.  can someone please help me figure out how to fix the problem?  I am new to coding and have to use the college's server, so I'm not sure how to correct the issue. Here is my code: &lt;?php if(isset($_POST['sendEmail'])){    $to = &quot;myemail@hotmail.com&quot;;    $from = $_POST['emailFrom'];    $subject =$_POST['subject'];    $message = $_POST['message'];    $headers  = 'MIME-Version: 1.0' . &quot;\r\n&quot;;    $headers .= 'Content-type: text/html; charset=iso-8859-1' . &quot;\r\n&quot;;    $headers  .= &quot;From: $from\r\n&quot;;  try {     mail($to, $subject, $message, $headers);     $msg = &quot;&lt;strong id=sentmess&gt;Your message was sent successfully!&lt;/strong&gt;&quot;; } catch(Exception $e) {         $msg = &quot;An Exception was thrown: &quot;.$e -&gt; getMessage().&quot;&lt;br&gt;&quot;; }}?&gt; &lt;?php if (isset($msg)) {echo $msg;}?&gt;
949
This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.  Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.  This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam  I figure this is a big topic in which I am essentially an ignorant simpleton.
11301
When choosing to delete an email via a filter, the message is sent to the trash. Is there any way to permanently delete it instead?  I tried deleting it twice with two different filters (the logic is that if you delete a message in the trash, it should be permanently deleted), and, although , it doesn't permanently delete the message.
19808
When my web form is filled and submitted, I get redirected to a page that says:     Thank you for submitting.   but theres a red warning box there that says:     Unable to send e-mail. Contact the site administrator if the problem persists.   I think its the SMTP server, but I don't know how to fix that.
113994
Is it possible to take a contact form and embed it into a page.html.twig or node.html.twig file? Or is the form only accessible via its contact/machine_name link?
108709
I want a utility that does something like this:  email --subject="xxx" --body=body.txt --to=to_address@hostname.com   (using pre-configured sender information for e.g. gmail). Note that body.txt is plain text and should be the body of the message, not an attachment. If the body is omitted it should pop up an editor and let me type in my message that way.  I could hack together a quick script that does this, but I was wondering if there's an easy way to do this with common unix tools?
55138
mail -s "subject" xxxxx@gmail.com &lt;test.html works, but only for plain text email.  What is the correct way to send HTML email using the Linux command mail?
60544
On webmail every user gets error "ERROR: Message not sent. Server replied: 354" while sending mails.   But mails are sent properly and reaches properly.  Can you tell me where is problem, and why it is occurred?  UPDATE: I found in some resources that this is not an error but standard information message. On the other side, it's annoying. Can you tell me if it is a true, and if it is how can I avoid it?
34937
I have my own email server and I've recently noticed that many of the emails I sent ended up in the recipients' spam folder. I have verified the IP of my mail server and it's not in any blacklist. What could be causing this? Could it be that my IP doesn't have a long history? How can I fix this?
78453
I have been watching how to implement the batch for sending more than 10 email but I get errors. When I send emails I have a limit 5 and also are sent several times to the same user email  global class SendBatchClass implements Database.Batchable&lt;sObject&gt;, Database.AllowsCallouts{     String query = '';      global Batchname(){     }     global SendBatchClass(String newBodyBatch,...){        this.body = newBodyBatch;        try{...}        catch(){...}     }     global Database.QueryLocator start(Database.BatchableContext BC) {          return Database.getQueryLocator(query);     }     global void execute(Database.BatchableContext BC, List&lt;Contact&gt; scope) {         SES sesEmail = new SES(as3.key,as3.secret);         for(sObject s: scope){             sesEmail.sendEmail(subRecipients,sender,subject,newBody);         }     }     global void finish(Database.BatchableContext BC) {      } }
61270
if (strstr($_SERVER['REQUEST_URI'],'index.php')) {     header('HTTP/1.0 404 Not Found'); }   Why wont this work? I get a blank page.
23293
I want to create a case which has an attachment, Billing Account, and topics. Given below is the code from my Test Class:  Scenario: Once user submit the case request and ask for approval. The request goes to the Manager for approval, once the request approves, an email goes to Legal team with an Case attachments in an email.  Topic__c tc = new Topic__c(Name ='My New topic'); Attachment att = new Attachment(Name = 'sample.pdf');  Case c = new Case(Origin = 'Phone',                           Subject = 'New Testing',                           Department__c = 'XXXXXXX', Priority = 'Normal',                           Topic__c = tc.Id,                           Risk_Approval__c = true); insert c;   I am getting the below error:     System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CaseTrigger: execution of BeforeInsert   My Trigger class:  trigger sendEAttachmentsInMail on Case (before insert, before update){  for(Case casevar : Trigger.new){          Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();          mail.setBccSender(false);         mail.setUseSignature(false);         mail.setTargetObjectId(casevar.Id);         mail.setTemplateId('XXXXXXXXX');         mail.saveAsActivity = false;        //Set email file attachments         List&lt;Messaging.Emailfileattachment&gt; fileAttachments = new List&lt;Messaging.Emailfileattachment&gt;();         for (Attachment a : [select Name, Body, BodyLength from Attachment where ParentId = :casevar.Id])         {         // Add to attachment file list         Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();         efa.setFileName(a.Name);         efa.setBody(a.Body);         fileAttachments.add(efa);         }         mail.setFileAttachments(fileAttachments);       //Send email         Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });          } }
24549
So I'm refactoring my code to implement more OOP.  I set up a class to hold page attributes.  class PageAtrributes  {   private $db_connection;   private $page_title;      public function __construct($db_connection)      {         $this-&gt;db_connection = $db_connection;         $this-&gt;page_title = '';     }      public function get_page_title()     {         return $this-&gt;page_title;     }      public function set_page_title($page_title)     {         $this-&gt;page_title = $page_title;     } }   Later on I call the set_page_title() function like so  function page_properties($objPortal) {         $objPage-&gt;set_page_title($myrow['title']); }   When I do I receive the error message:     Call to a member function set_page_title() on a non-object   So what am I missing?
100105
I received an email from Client@Example.com.  In conjunction with the Email-to-Case function, our Assignment Rules and Round-Robin Apex code dictate that when email is sent to our company using MyMailQueue@myCompany.com, create a case and assign that case to a queue called MyMailQueue.   Other than stepping through the assignment rules and Apex code, is there another way to see that the case was created because mail was sent to the address above?   In other words, I'm looking for a way to see that the email address above is definitely the one that was used because we use several different email addresses in Email-to-Case.
111739
I'm getting a lot of mail in my root user's mail account. This appears to be mostly reports and errors from things like cron scripts. I'm trying to work though and solve these things, possibly even have them be piped to some sort of "dashboard" - but until then how can I have these messages go to my personal e-mail account instead?
72814
I would like to create an Outlook rule that stops me from sending out emails that have more than ten email addresses in the "To:" line. Is this even possible? I'm using Outlook 2010 on Windows 7 64-bit.  My reasoning: I send out a distribution letter to a large number of addresses. I usually send this email to myself with the distribution list addresses in the "BCC:" line. Every once in a while I mess up and accidentally put the distribution list addresses on the "To:" line instead. This is a problem because then each email recipient will see all the addresses on the list. I want Outlook to stop me from doing this, or at least warn me before I send it out.  I also welcome suggestions on how to get around this problem.
39455
I've a single host with CentOS 6.3. I manage that host via SSH. The server itself is uname -n: servername.foo.com. On this host I've multiple, unrelated httpd vhosts.  The problm is: when one vhost sends a mail with PHP mail(), the sent mail header contains multiple servername.foo.com traces (Message ID is xyx@servername.foo.com, Received by is servername.foo.com and so on).  The mail are sent by postfix. No other mail services are used on this server.  The question is: how can I sent e-mail from each vhost pretending to be thatVhost.com instead of leaving traces of servername.foo.com in the mail headers?
36973
How does Stack Overflow handle spam?